stefanm wrote:
According to the Hibernate reference, chapter 11.2.2 "Using JTA", you have to use the JTA API directly...
http://www.hibernate.org/hib_docs/v3/reference/en/pdf/hibernate_reference.pdfOK - so did you read 11.2.2? It states exactly what I said. Where does it say that you need to use the JTA API directly... I could not find it...
I quote two sources from the reference.pdf, that support my statements:
3.8.3. Current Session context management with JTA
Quote:
Your code can either use JTA programmatically through UserTransaction, or (recommended for portable code) use the Hibernate Transaction API to set transaction boundaries.
From 11.2.2. Using JTA
Quote:
If your persistence layer runs in an application server (e.g. behind EJB session beans), every datasource connection
obtained by Hibernate will automatically be part of the global JTA transaction. Hibernate offers two strategies for this integration.
If you use bean-managed transactions (BMT) Hibernate will tell the application server to start and end a BMT
transaction if you use the Transaction API. So, the transaction management code is identical to the nonmanaged
environment.
Again..."So, the transaction management code is identical to the nonmanaged environment."