This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DSRA9110E Connection is closed

 
ricky wong
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

My MDB EJB application retrieves a MQ message, it creates a thread to handle this MQ message. This thread uses SQLJ and datasource to connect to DB2 and insert/update all data to database. When the number of MQ Messages (e.g. 10, 100) are received by MDB and the corresponding of threads are trying to insert/update its data to DB2, some of threads get an error "DSRA9110E; Connection is closed".

Each thread creates its own connection and dbcontext objects and the transaction is quite short (Only insert/update data to around 3 tables). In addition, the MQ message of each thread has a unique id. The unique id is a primary key of the tables.

As I am new to SQLJ, does anyone know what is the problem? I have tried to add logic to check whether a DBConnection is closed or not after getting it from datasource. It seems that all connections are not closed when received from datasource but some of them are closed during the transaciton processing (when a number of threads are running). Could anyone give me advise or suggestion?

I am using WSAD v5.1.2 and DB2 v7.2.3 (Windows version). I am not sure this problme is still occurred when deploying the EJB application to WAS v5.1.

Thanks.
Ricky
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does each method which uses a Connection declare a local Connection variable? Anything else is not thread safe.
 
ricky wong
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it is defined a private variable. For the thread safe, how can I define it?
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you need to post your code.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic