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 > Insert after Delete fails. Please Help!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-02-11, 09:44
foutjo foutjo is offline
Registered User
 
Join Date: Jun 2011
Posts: 3
Insert after Delete fails. Please Help!!

Hi everyone. I am a newbie and I need some help.

Here is my situation.

Java app does a delete of a record and then does an insert of the same record.

Database #1 - Works fine never had a problem.

Had our DBA create an exact copy of Database#1 for our Qual region. This is called Database#2.

When the java application runs it now fails on the delete with:

SQL0803N One or more values in the INSERT statement, Update statment, or foreign key update caused by a DELETE statement are not valid becaue the primary key, unique constraint or unique index identified by "2" constrains table DATABASE2.JDBPFFE from having duplicate rows or columns. SQLSTATE=23505

Any ideas on why this would happen? Now here is the kicker..... I had our DBA stop and restart the database and it started working. Well for a while and then the error started popping up again. Its this inconsistency that confuses me. Why would it work after a restart and then after a while start erroring out?

Is there some log file that I could look at and compare the differences between the application processing database#1 and database#2?

Any help is greatly appreciated.

Thanks.
Reply With Quote
  #2 (permalink)  
Old 06-02-11, 09:46
foutjo foutjo is offline
Registered User
 
Join Date: Jun 2011
Posts: 3
Error on Insert not Delete

This error was on the Insert not Delete. Sorry.
Reply With Quote
  #3 (permalink)  
Old 06-02-11, 10:23
tonkuma tonkuma is online now
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
Some other program(same Java app or not) may be running.
Reply With Quote
  #4 (permalink)  
Old 06-03-11, 07:15
foutjo foutjo is offline
Registered User
 
Join Date: Jun 2011
Posts: 3
Nothing else is running.
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