We're updating the issue view to help you get more done. 

JtaIsolationDelegate tries to resume non-existant transaction

Description

On MySQL the identifier generator does its select/update ID_TABLE thing in a separate transaction. The main transaction is suspended and resumed by JtaIsolationDelegate.

This code fails (new suspended persistence context mode in JPA 2.1, without a joined transaction and auto-commit for reading-only):

1 2 3 EntityManager em = JPA.createEntityManager(); Item newItem = new Item("New Item"); em.persist(newItem); // Doesn't have to suspend a transaction to get the identifier, since there is none

With Bitronix, TransactionManager#suspend() in this case returns null, which is legal:

http://docs.oracle.com/javaee/1.4/api/javax/transaction/TransactionManager.html#suspend()

Environment

None

Status

Assignee

Unassigned

Reporter

Christian Bauer

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

4.3.0.Beta3

Priority

Major