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 > Rollback problem....

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-07-03, 01:22
milindk22 milindk22 is offline
Registered User
 
Join Date: Oct 2003
Posts: 5
Question Rollback problem....

I have 3 tables say A, B, C. Out of which the Table C is LOCKED by some user.
I use some form to insert records in Table A & B and update C.
The Sql statements are in sequence.
It inserts rows in Table A & B.
But since Table C is LOCKED when I try to update it raises an error, so I rollback the transaction.

BUT STILL THE ROWS Gets committed in Table A & B. I DON'T want this.
Could anyone provide solution.


Thanks in Advance.
-Milind
Reply With Quote
  #2 (permalink)  
Old 11-07-03, 01:57
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
I am not sure which mechinism you are using to submit the statements. Make sure that auto-commit is not turned on.
Reply With Quote
  #3 (permalink)  
Old 11-10-03, 04:19
milindk22 milindk22 is offline
Registered User
 
Join Date: Oct 2003
Posts: 5
Quote:
Originally posted by Marcus_A
I am not sure which mechinism you are using to submit the statements. Make sure that auto-commit is not turned on.
I'm using Centura 2000 GUI tool to do inserts and updates and this tool Centura gets connected to DB2 Database through DB2 Connect, with isolation level as "RL".

-regards
Milind
Reply With Quote
  #4 (permalink)  
Old 11-10-03, 05:29
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
The issue is auto-commit (commits after every SQL statement), not isolation level. Check with Centura 2000 to see what they say about auto-commit.
__________________
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
  #5 (permalink)  
Old 11-10-03, 05:53
milindk22 milindk22 is offline
Registered User
 
Join Date: Oct 2003
Posts: 5
Quote:
Originally posted by Marcus_A
The issue is auto-commit (commits after every SQL statement), not isolation level. Check with Centura 2000 to see what they say about auto-commit.
Thanks for the info., but in our application "AUTOCOMMIT" is OFF. Whether in DB2 Connect are there any setting related to AUTOCOMMIT (while insallaion etc.)
Reply With Quote
  #6 (permalink)  
Old 11-10-03, 06:27
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
Check out "Compound SQL (Dynamic)" in the SQL Reference Volume 2. This allows you to submit multiple dynamic SQL statements that will be rolled back if they don't all complete successfully.

Also, for the timeout problem, I would make sure that the locktimeout database parameter is not set to zero (maybe set to 2-5 seconds).
__________________
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