cayenne-commits mailing list archives

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

    [ https://issues.apache.org/jira/browse/CAY-1630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13164662#comment-13164662
] 

Andrus Adamchik commented on CAY-1630:
--------------------------------------

In your example above you are guaranteed to get the failed object. Of course it would look
like this:

try {
  context.commitChanges();
} catch (OptimisticLockException e) {
  Object o = Cayenne.objectForPK(context, e.getFailedObjectId());
} 

However the API in your patch allowed a user to pass any context at any time to the method,
which would not guarantee a meaningful result. So I had to change it.
                
> [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