I am trying to understand what is the difference between JTA, Spring and Bitronix?
What should I use for transactions in Hibernate persistence?
JTA Transactional annotation applies to CDI-managed beans and classes defined as managed beans by the Java EE specification, whereas Spring's Transactional annotation applies only to Spring beans. It's also worth noting that support for JTA 1.2 was introduced in Spring Framework 4.0.
The Java™ Transaction API (JTA) allows applications to perform distributed transactions, that is, transactions that access and update data on two or more networked computer resources.
Bitronix Transaction Manager allows Mule to automatically recover interrupted transactions on restart.
JPA (Java Persistence API) is the Java ORM standard/specification for storing, accessing, and managing Java objects in a relational database. Hibernate is an implementation of the Java Persistence API (JPA) specification. JTA (Java Transaction API) is the Java standard/specification for distributed transactions.
JTA is an API for distributed transaction management. It can be implemented as part of application server or as a standalone transaction manager.
Bitronix Transaction Manager is a standalone implementation of JTA.
Spring is a framework that provides (among other features) unified interface for transaction management. In particular, Spring-managed transaction can use JTA implementation as a backend.
In other words, in a typical Spring and Hibernate application you manage transactions using Spring transaction support, and Spring is configured to use one of backend transaction managers:
HibernateTransactionManager
)JtaTransactionManager
). In particular:
JtaTransactionManager
uses built-in JTA implementationIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With