optimistic locking?

From: Bill Dudney (bdudne..ac.com)
Date: Tue Jun 08 2004 - 05:58:26 EDT

  • Next message: Jim Menard: "Cayenne in action"

    Hi All,

    I would like to introduce a 'version' property on my objects and use it
    for optimistic locking.

    I modified my model to add optimistic locking (with the checkbox
    'Optimistic Locking' in the Entity tab) to each of my classes and
    specified which attributes in each was 'Used for Locking' (the version
    attribute).

    I expected Cayenne to automatically set the 'version' attribute to zero
    on initialization and then maintain its value with each commit. i.e.
    Create Foo, version = 0, update Foo version = 1 and I don't have to
    know or care about this version field. It did not so I initialize it to
    zero in the default constructor. Is this the expected usage?

    Thanks!

    -bd-



    This archive was generated by hypermail 2.0.0 : Tue Jun 08 2004 - 05:58:26 EDT