Community
Participate
Working Groups
Created attachment 178644 [details] proposed fix and a test case If calling uow.writeChanges(); uow.commit(); with code that will cause a constraint violation and using defered constraints, the exception will be thrown when the transaction commits, during the uow.commit() call. Instead of getting the underlying constraint violation exception from the database, a ConcurrencyException "Exception Description: A signal was attempted before wait() on ConcurrencyManager. This normally means that an attempt was made to commit or rollback a transaction before it was started, or to rollback a transaction twice. " is thrown. In addition, the unitOfWork is left in the CommitTransactionPending state, so that a uow.release() will also result in the same ConcurrencyException. This situation only occurs if writeChanges is used, and only on a UnitOfWorkImpl (not the new RepeatableWriteUnitOfWork, as the state isn't changed to CommitTransactionPending). Problem is that commitTransactionAfterWriteChanges calls rollbackTransaction() before calling release() when an exception occurs. rollbackTransaction will mark the transaction for rollback, causing the ConcurrencyException when release is called because the state is still in CommitTransactionPending.
fix checked into trunk (2.2) at revision 8183
*** Bug 324454 has been marked as a duplicate of this bug. ***
fix checked into 2.1.2 in revision 8218
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink