cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (Closed) (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CAY-1630) [PATCH] On OptimisticLockException, add method to return the object that caused the failure
Date Tue, 06 Dec 2011 04:45:40 GMT

     [ https://issues.apache.org/jira/browse/CAY-1630?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik closed CAY-1630.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 3.1M4

I committed a slightly different implementation that returns ObjectId (taken from the source
of the exception)... Not attempting to return an object, as "context.getGraphManager().getNode(oid)"
is undeterministic as object cache might have been cleared by the time this method was invoked...
More generally a different ObjectContext can be passed to 'getFailedObject' method that does
not have an object in question. 

So returning 'getFailedObjectId' and leaving this up to the user to decide how to turn that
into object (the most obvious way being via Cayenne.objectForPk)
                
> [PATCH] On OptimisticLockException, add method to return the object that caused the failure
> -------------------------------------------------------------------------------------------
>
>                 Key: CAY-1630
>                 URL: https://issues.apache.org/jira/browse/CAY-1630
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Core Library
>    Affects Versions: 3.1M4
>         Environment: Mac 10.6
>            Reporter: John Huss
>            Priority: Minor
>              Labels: patch
>             Fix For: 3.1M4
>
>         Attachments: optistic_lock_failed_object_patch.txt, optistic_lock_failed_object_test_patch.txt
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> This patch adds a method to OptimisticLockException that returns the object the was the
cause of the locking failure. This is useful if you want to resolve the error automatically
somehow. A test case is also included.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message