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 > Deadlock error after making multiple INSERTs

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-21-09, 10:08
lshewmon lshewmon is offline
Registered User
 
Join Date: Oct 2009
Posts: 1
Deadlock error after making multiple INSERTs

I'm looping thru a collection of records gotten from a SELECT statement on a DB2 table and from each of these records I'm inserting a new row in the same table. First I do the SELECT query, add each row's info to a java collection, then go thru the collection and for each object in the collection I call an insert method which inserts a new row (not a duplicate, I've changed some of the key info) in the same table that I did the SELECT on.

From my debug code I seem to be going thru the right methods the right number of times and not generating any errors, but it's not inserting the rows in the table and when I try and access the table after I've run the routine I get the following error:
Unsuccessful execution caused by deadlock or timeout. Reason code "00C9008E"
Reply With Quote
  #2 (permalink)  
Old 10-21-09, 10:45
Lenny77 Lenny77 is offline
Registered User
 
Join Date: Jul 2009
Location: NY
Posts: 886
Depends on your instalation setting you have to make commits after some number of inserts (updates, deletes).

Lenny
Reply With Quote
  #3 (permalink)  
Old 10-21-09, 14:32
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
00C9008E is a lock timeout. Do you have multiple connections or just 1?
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
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