[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5222) upgrade to OPTIMISTIC_FORCE_INCREMENT fails

Christian Bauer (JIRA) noreply at atlassian.com
Wed Nov 23 11:54:21 EST 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44397#comment-44397 ] 

Christian Bauer commented on HHH-5222:
--------------------------------------

The problem is not the mapping from JPA to old-Hibernate LockMode, that seems to be correct.

But AbstractLockUpgradeEventListener#upgradeLock executes only if ( requestedLockMode.greaterThan( entry.getLockMode()). And because an entity is in hibernate.LockMode.READ(5) it will never "upgrade" to a hibernate.LockMode.OPTIMISTIC(3) when you call entityManager.lock().

This code path is not executed when deciding the same lock mode e.g. with Query.setLockMode() or even entitymanager.find(lockmode). Those are fine.




> upgrade to OPTIMISTIC_FORCE_INCREMENT fails
> -------------------------------------------
>
>                 Key: HHH-5222
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5222
>             Project: Hibernate Core
>          Issue Type: Bug
>    Affects Versions: 3.6.8, 4.0.0.CR6
>            Reporter: Scott Marlow
>            Assignee: Scott Marlow
>         Attachments: HHH-5222-test.txt
>
>
> See hhh5032-2.patch attached to HHH-5032 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list