EclipseLink marks transaction RollbackOnly when applying timeout for "nonread" queries [SPR-10068] #14701
Labels
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Igor Mihalik opened SPR-10068 and commented
Transaction "RollbackOnly" problem occurs when using EclipseLink (any version up to 2.5.0-M5) together with Spring ORM and "timeout" attribute on
@Transactional
in case of "delete" query.EntityManagerFactoryUtil class in method "applyTransactionTimeout" sets a hint "javax.persistence.lock.timeout". However EclipseLink throws back an exception:
java.lang.IllegalArgumentException: Query delete from [*], query hint javax.persistence.lock.timeout is not valid for this type of query.
Moreover EclipseLink sets RollbackOnly on current transaction and doCommit throws: Exception in thread "main" org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Transaction rolled back because transaction was set to RollbackOnly.
Attached is a simple project to demonstrate the problem.
Affects: 3.1.3
Attachments:
Backported to: 3.1.4
The text was updated successfully, but these errors were encountered: