Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2006
    Posts
    2

    Unanswered: 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

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    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

  3. #3
    Join Date
    Sep 2006
    Posts
    2
    Thanks, Andy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •