Reputation: 229
I have Confusion regarding Transaction manager used. Below are few Transaction Manger which I know: -Hibernate Transaction Manager -JPA Transaction manager -JDBC Transaction manger -JTA Transaction Manger
In which case I can use Above transaction manager and how they work or differ from each other ..
And how UserTranasction and Transaction Manger of Application server plays any role in this.
Thanks in advance
Upvotes: 1
Views: 424
Reputation: 1912
Your project can have container managed transaction or application managed transaction.
Container managed is when your server (jboss, glassfish, etc) that has JTA handles the transaction, that is the default behavior.
Application managed is when your project handles the transaction. You can use the UserManagerTransaction that will give you control over the transaction methods or you can use "JPA programmatic transactions" (I just invented this term).
You can create a transaction programmatic transaction by doing entityManager.getTransaction().begin(). You can use the Hibernate transaction, that is the same of the Hibernate transaction.
With Hibernate transaction you will be accessing all Hibernate functions that do not belong to the JPA Spec.
Upvotes: 1