Btw. out if interest, what is the motivation for using the JTA API in this example, which requires the awkward TM look-up? Using RESOURCE_LOCAL with em.getTransaction().begin() / em.getTransaction().commit() seems a bit easier, it also comes at the advantage that one can't forget to join the existing TX in case one has several subsequent transactions on one entity manager.
|