Community
Participate
Working Groups
If I enable JDBC batching, in case of an optimistic comparison failure a RollbackException (upon commit) or PersistenceException (upon flush) is thrown, which has an org.eclipse.persistence.exceptions.OptimisticLockException as its cause. A javax.persistence.OptimisticLockException would be expected instead. If I disable JDBC batching, the cause is a javax.persistence.OptimisticLockException as expected.
Created attachment 174988 [details] proposed patch
Created attachment 175059 [details] proposed patch and regression test This patch now takes into account that the commitToDatabase method is also invoked from flush. The patch now contains regression tests TestOptimistic for OLEs upon - commit - flush - query (implicit flush) The tests are executed with and without batching.
Created attachment 179243 [details] proposed patch and regression test Updated and resolved on 2010/09/20.
Created attachment 189210 [details] proposed patch enabling the regression test TestOptimistic
Reviewed by Michael O'Brien Tested on MySQL, MaxDB Checked in at 8981.
The patch could be further refactored in order to move the translation of EclipseLink OLEs to JPA OLEs from core to the JPA component. This is a bit of a challenge as JTA commits the UOW bypassing the JPA layer.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink