I am trying to understand what is the difference between JTA, Spring and Bitronix?
What should I use for transactions in Hibernate persistence?
I am trying to understand what is the difference between JTA, Spring and Bitronix?
What should I use for transactions in Hibernate persistence?
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 implementationFor example, when any transaction operation performed, at the same instant of time, amount should be deducted from one account and added in another account. But some time if second operation fails, then it does not rolled back the transaction. It also helps to avoid deadlock situation.
© 2022 - 2024 — McMap. All rights reserved.