Optimistic locking

From: Marc Gabriel-Willem (marc.gabriel-wille..ide-international.com)
Date: Tue Apr 10 2007 - 11:20:22 EDT

  • Next message: jerome moliere: "Re: AUto PK/ how to desactivate"

    Hi,

     

    I have some trouble with the optimistic locking function.

    I set the 'optimistic locking' option to an ObjEntity and moreover I set
    an attribute as "used for locking".

     

    I'm in a web environment.

     

    When I do some modification in a DataObject, the 'log' displayed by
    Cayenne displays properly the query using the attribute for locking
    check.

    But, when a concurrent client modifies the 'same' DataObject, no error
    is detected ... because the new value for the optimistic check is used.

     

    It is important to note that the DataObject is modified by different
    browser (so different session data context) and by different child data
    context !

     

    Scenario:

     

    My original record > attr1=MyAttr1, attr2=10:15:10

    My record modified by client #1> attr1=MyAttr2,
    attr2(UseForLock)=10:18:15 [ attrSpecifiedInWhereClause: 10:15:10 ]

    My record modified by client #2> attr1=MyAttr3,
    attr2(UseForLock)=10:19:40 [ attrSpecifiedInWhereClause: 10:18:15 ]

     

    The value of the attribute used for optimistic locking seems to be
    refreshed...

     

    Thank you,

    Marc



    This archive was generated by hypermail 2.0.0 : Tue Apr 10 2007 - 11:20:47 EDT