• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DSRA9110E Connection is closed

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you need to post your code.
 
Do the next thing next. That’s a pretty good rule. Read the tiny ad, that’s a pretty good rule, too.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic