Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2014-04-04T13:28:03Z by Damery
Damery
Damery
44 Posts
ACCEPTED ANSWER

Pinned topic ROLLBACK ROW CHANGE TOKEN is changing?

‏2014-02-28T20:24:55Z |

Hello I hope someone can explain something to me.

We are trying to use ROW CHANGE TOKEN for data integrity checking, however we have discovered that if a record has a row change token of 1 and we try to update to 2 but have to roll back then the data reverts back to the previous values but the ROW CHANGE TOKEN stays at 2 instead of going back to the original value of 1....

Is this the way that this functions? Have we missed something in set up? Do I not understand ROW CHANGE TOKEN?

 

Any and all help appreciated.

  • NickLawrence
    NickLawrence
    59 Posts
    ACCEPTED ANSWER

    Re: ROLLBACK ROW CHANGE TOKEN is changing?

    ‏2014-03-03T20:56:24Z  in response to Damery

    See http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Fsqlp%2Frbafyrcexpr.htm (Row Change Expressions) and http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Fsqlp%2Frbafysqlprcts.htm (How to create a ROW CHANGE TIMESTAMP column).
     
    If a table does not contain a row change timestamp column, you can still use a row change token expression, but the result is less precise because DB2 does not keep track of a token ID for each individual row. (This approach should still work for optimistic locking, but may be more pessimistic than you want. The scenario you describe will indicate that the row might have changed - when it has not)
    If the table has a row change timestamp column, then you should get the results you expect....because DB2 has access to the updated timestamp for each specific row.

     

    Updated on 2014-03-03T20:57:55Z at 2014-03-03T20:57:55Z by NickLawrence
    • Damery
      Damery
      44 Posts
      ACCEPTED ANSWER

      Re: ROLLBACK ROW CHANGE TOKEN is changing?

      ‏2014-04-04T13:28:03Z  in response to NickLawrence

      Looks like we will be using Row Id, Row Change Token with Row Change Timestamp for concurrency validation.