Re: transactions, row locking, race condition?

From: Tore Halset (halse..vv.ntnu.no)
Date: Mon Apr 11 2005 - 09:05:47 EDT

  • Next message: Tore Halset: "Re: transactions, row locking, race condition?"

    On Apr 11, 2005, at 14:23, tnaki..ofthome.net wrote:

    > I have a feeling we're on to something now: I wasn't clear on what
    > optimistic locking really is...not sure if I am now, for that matter.
    > Would it be too much if I asked you to illustrate how you would do
    > this?
    > From what I can tell, I'd retrieve an object from a table with
    > optimistic locking set, and try to save the timestamp until I can
    > confirm that a row was updated - how do I confirm the update took
    > place? Does cayenne somehow take care of this for me?

    Using optimistic locking cayenne will create a sql update statement
    like:
    update candidates set my_timestamp='2005-04-11' where id=17 and
    my_timestamp is null;

    "my_timestamp is null" is caused by the optimistic locking and is used
    to make sure the row has not been modifyed by another client.

    http://www.objectstyle.org/confluence/display/CAY/
    Optimistic+Locking+Explained

      - Tore.



    This archive was generated by hypermail 2.0.0 : Mon Apr 11 2005 - 09:05:53 EDT