[hibernate-issues] [Hibernate-JIRA] Resolved: (EJB-438) Wrong exception thrown on optimistic locking failure due to deleted entity using hibernate.jdbc.batch_versioned_data=false
Juraci Paixao Krohling (JIRA)
noreply at atlassian.com
Wed May 20 09:47:13 EDT 2009
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-438?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Juraci Paixao Krohling resolved EJB-438.
----------------------------------------
Resolution: Fixed
Backported to:
v3_3_2_GA_CP - Revision 16597
v3_4_0_GA_CP - Revision 16598
v3_2_1_GA_CP - Revision 16602
> Wrong exception thrown on optimistic locking failure due to deleted entity using hibernate.jdbc.batch_versioned_data=false
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: EJB-438
> URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-438
> Project: Hibernate Entity Manager
> Issue Type: Bug
> Affects Versions: 3.3.1.GA, 3.3.2.GA, 3.4.0.GA
> Environment: Entity manager v3_3_2_GA_CP / RemoveTest, hibernate.jdbc.batch_versioned_data = false
> Reporter: Juraci Paixao Krohling
> Assignee: Juraci Paixao Krohling
> Fix For: 3.3.3, 3.4.1, 3.5
>
>
> The test testUpdatedAndRemove on RemoveTest is failing due to a wrong exception being thrown when using hibernate.jdbc.batch_versioned_data as false (the default option).
> When it is set as "false", the exception is processed on method AbstractEntityManagerImpl#wrapStaleStateException . On line 647 it tries to load the original entity, but it doesn't exists anymore, throwing a EntityNotFoundException.
> The suggestion is to wrap line 647 in a try/catch, to catch EntityNotFoundException and rethrow the original exception as OptimisticLockException, as it is the only case I can think of that the identifier is present, it is in the context of a optimistic locking exception and the entity is not found in the database.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list