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 didn't work

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-14-06, 13:02
keegan92840 keegan92840 is offline
Registered User
 
Join Date: Sep 2006
Posts: 2
Rollback didn't work

Hello,

My purpose is to verify COMMIT and ROLLBACK transaction in DB2.
I created a table, then inserted a record into it. After that, I updated the record with a new value, then did ROLLBACK as below:

retcode = SQLEndTran(SQL_HANDLE_DBC, dbc, SQL_ROLLBACK);

it returned successfully, but when I checked the record, it still updated with the new value. I expected the record wouldn't be updated.

Do you know what's wrong?

Is it because autocommit is set to on? How do I set if off both in coding and command line?

Thanks
Keegan
Reply With Quote
  #2 (permalink)  
Old 09-14-06, 13:31
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
It is most probably due to autocommit. Turning it off in coding depends on the language you are using. For the CLP you can issue:
UPDATE COMMAND OPTIONS USING C OFF

HTH

Andy
Reply With Quote
  #3 (permalink)  
Old 09-14-06, 15:39
keegan92840 keegan92840 is offline
Registered User
 
Join Date: Sep 2006
Posts: 2
Thanks, Andy.
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