|
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):
EntityManager em = JPA.createEntityManager();
Item newItem = new Item("New Item");
em.persist(newItem);
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()
|