If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 SQL Error: SQLSTATE: 40001, SQLERRMC: 68

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: May 2008
Posts: 1
DB2 SQL Error: SQLSTATE: 40001, SQLERRMC: 68

Hi,

I am getting the following exception when there are multiple instances of EJB that try to update the same row in the database. I have a sequence number stored in a properties table and two nodes in a cluster have EJBs running that want to increment this sequence number. The exception is occuring when the code does a save on the hiberate DAO object, to update the row.

Could someone please tell me what do I need to do to avoid this error? I would really appreciate your help.

Caused by: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -911, SQLSTATE: 40001, SQLERRMC: 68
at com.ibm.db2.jcc.b.rc.b(rc.java:3180)
at com.ibm.db2.jcc.a.eb.i(eb.java:227)
at com.ibm.db2.jcc.a.eb.a(eb.java:183)
at com.ibm.db2.jcc.a.eb.a(eb.java:34)
at com.ibm.db2.jcc.a.s.a(s.java:30)
at com.ibm.db2.jcc.a.h.Gb(h.java:325)
at com.ibm.db2.jcc.b.rc.R(rc.java:3022)
at com.ibm.db2.jcc.a.d.f(d.java:1070)
at com.ibm.db2.jcc.b.r.a(r.java:191)
at com.ibm.db2.jcc.b.rc.c(rc.java:302)
at com.ibm.db2.jcc.b.rc.next(rc.java:277)
at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.next(WSJ dbcResultSet.java:2419)
at org.hibernate.loader.Loader.doQuery(Loader.java:68 5)
at org.hibernate.loader.Loader.doQueryAndInitializeNo nLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:221 1)
... 29 more

Thanks,
Priya
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,713
You are getting a locktimeout. That means that one of the applications is holding a lock on a resource (probably a row) and another application is trying to acquire an incompatible lock on the same resource. The amount of time the second application waits depends on the setting of locktimeout (in seconds) in the db config. Most people have it set to about 30 seconds (the default is -1 which means wait forever).

Most likely the first application is not committing after the update (insert, update or delete). A commit will release the lock.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On