Optimistic lock failure

From: David Norwood (david..irtuant.com)
Date: Thu Dec 07 2006 - 09:45:15 EST

  • Next message: Mike Kienenberger: "Re: Optimistic lock failure"

    Hi,

     

    I the following transaction I insert a new record into a table, then
    directly run rules on the data inserted and call an update to set specific
    columns after running the rules. See the following error; isn't it OK for
    the same user to update the table after inserting a row? Why am I getting
    this error??

     

    TIA,

     

    -david

    ---------------- error output -----------------------

    2006-12-06 09:50:52,406 DEBUG [org.jboss.mx.loading.RepositoryClassLoader]
    setRepository,
    repository=org.jboss.mx.loading.HeirarchicalLoaderRepository..c1f2,
    cl=org.jboss.mx.loading.UnifiedClassLoader..ec21a{ url=null ,addedOrder=0}

    2006-12-06 09:50:52,421 INFO [org.objectstyle.cayenne.access.QueryLogger]
    --- will run 1 query.

    2006-12-06 09:50:52,421 INFO [org.objectstyle.cayenne.access.QueryLogger]
    UPDATE dbo.dochistory SET AVGREADING = ? WHERE ID = ? AND AUDITOR IS NULL
    AND AVGREADING IS NULL AND DATA1 = ? AND DATA10 IS NULL AND DATA2 IS NULL
    AND DATA3 IS NULL AND DATA4 IS NULL AND DATA5 IS NULL AND DATA6 IS NULL AND
    DATA7 IS NULL AND DATA8 IS NULL AND DATA9 IS NULL AND DATETIME = ? AND INFO1
    IS NULL AND INFO10 IS NULL AND INFO2 IS NULL AND INFO3 IS NULL AND INFO4 IS
    NULL AND INFO5 IS NULL AND INFO6 IS NULL AND INFO7 IS NULL AND INFO8 IS NULL
    AND INFO9 IS NULL AND ISDELETED = ? AND ISFAILURE = ? AND ISRECHECK = ? AND
    PERSONNAME = ? AND PRESHIPPER IS NULL AND PRODUCTCODE IS NULL AND VERIFIER
    IS NULL AND LOCATIONID = ? AND ORG_ID = ? AND PACKAGEID = ? AND USR_ID = ?

    2006-12-06 09:50:52,421 INFO [org.objectstyle.cayenne.access.QueryLogger]
    [bind: 2.229999999999999982236431605997495353221893310546875, 4557, NULL,
    NULL, 2.229999999999999982236431605997495353221893310546875, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2006-12-06 09:50:52.078', NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'false', 'false',
    'false', 'Tom Johnson', NULL, NULL, NULL, 196, 34, 1179, 9]

    2006-12-06 09:50:52,468 INFO [org.objectstyle.cayenne.access.QueryLogger]
    *** error.

    org.objectstyle.cayenne.access.OptimisticLockException: [v.1.2.1 August 30
    2006] Optimistic Lock Failure, SQL: [UPDATE dbo.dochistory SET AVGREADING =
    ? WHERE ID = ? AND AUDITOR IS NULL AND AVGREADING IS NULL AND DATA1 = ? AND
    DATA10 IS NULL AND DATA2 IS NULL AND DATA3 IS NULL AND DATA4 IS NULL AND
    DATA5 IS NULL AND DATA6 IS NULL AND DATA7 IS NULL AND DATA8 IS NULL AND
    DATA9 IS NULL AND DATETIME = ? AND INFO1 IS NULL AND INFO10 IS NULL AND
    INFO2 IS NULL AND INFO3 IS NULL AND INFO4 IS NULL AND INFO5 IS NULL AND
    INFO6 IS NULL AND INFO7 IS NULL AND INFO8 IS NULL AND INFO9 IS NULL AND
    ISDELETED = ? AND ISFAILURE = ? AND ISRECHECK = ? AND PERSONNAME = ? AND
    PRESHIPPER IS NULL AND PRODUCTCODE IS NULL AND VERIFIER IS NULL AND
    LOCATIONID = ? AND ORG_ID = ? AND PACKAGEID = ? AND USR_ID = ?], WHERE
    clause bindings: [USR_ID=9, DATA6=NULL, ISRECHECK='false',
    ISDELETED='false', INFO1=NULL, LOCATIONID=196, DATA5=NULL, AVGREADING=NULL,
    AUDITOR=NULL, INFO8=NULL, DATA2=NULL, INFO2=NULL, DATETIME='2006-12-06
    09:50:52.078', VERIFIER=NULL, DATA9=NULL, INFO4=NULL, PACKAGEID=1179,
    ID=4557, INFO9=NULL, INFO3=NULL, DATA8=NULL, INFO6=NULL, DATA7=NULL,
    INFO7=NULL, PERSONNAME='Tom Johnson', PRESHIPPER=NULL, DATA4=NULL,
    DATA10=NULL, ORG_ID=34, DATA3=NULL, INFO10=NULL, INFO5=NULL,
    PRODUCTCODE=NULL,
    DATA1=2.229999999999999982236431605997495353221893310546875,
    ISFAILURE='false']

           at
    org.objectstyle.cayenne.access.jdbc.BatchAction.runAsIndividualQueries(Batch
    Action.java:235)

           at
    org.objectstyle.cayenne.access.jdbc.BatchAction.performAction(BatchAction.ja
    va:117)

     



    This archive was generated by hypermail 2.0.0 : Thu Dec 07 2006 - 09:45:53 EST