Atomikos vs JOTM vs Bitronix vs? [closed]

I am new to JTA and it’s underlying transaction managers. Can anyone explain the pros/cons of each of these? Feel free to add others I didn’t list in title. Standalone transaction managers I’m aware of include Bitronix, SimpleJTA, Tyrex (dead?), JOTM (used in Jonas), GeronimoTM/Jencks (used in Geronimo), JBossTS (used in JBoss) and Atomikos. I’ve … Read more

Difference between a “jta-datasource” and a ” resource-local ” datasource?

The terms “jta-datasource” and “resouce-local datasource” are a little vague to me. I guess you actually refer to the jta-datasource and non-jta-datasource elements. In short: if the transaction type of the persistence unit is JTA, the jta-datasource element is used to declare the JNDI name of the JTA data source that will be used to … Read more

Difference between JTA, JPA and plain JDBC in hibernate

In order for a difference to exist, there should be something in common, and apart from being database-related (although JTA is not only that), they have nothing more in common: JPA is a standard for Java object-relational mapping – it specifies a set of annotations and an interface –EntityManager to perform persistence operations with the … Read more

persistence.xml different transaction-type attributes

Defaults Default to JTA in a JavaEE environment and to RESOURCE_LOCAL in a JavaSE environment. RESOURCE_LOCAL With <persistence-unit transaction-type=”RESOURCE_LOCAL”> you are responsible for EntityManager (PersistenceContext/Cache) creating and tracking You must use the EntityManagerFactory to get an EntityManager The resulting EntityManager instance is a PersistenceContext/Cache An EntityManagerFactory can be injected via the @PersistenceUnit annotation only (not … Read more

What is the difference between JTA and a local transaction?

JTA is a general API for managing transactions in Java. It allows you to start, commit and rollback transactions in a resource neutral way. Transactional status is typically stored in TLS (Thread Local Storage) and can be propagated to other methods in a call-stack without needing some explicit context object to be passed around. Transactional … Read more

Persistence unit as RESOURCE_LOCAL or JTA?

JPA implementations have the choice of managing transactions themselves (RESOURCE_LOCAL), or having them managed by the application server’s JTA implementation. In most cases, RESOURCE_LOCAL is fine. This would use basic JDBC-level transactions. The downside is that the transaction is local to the JPA persistence unit, so if you want a transaction that spans multiple persistence … Read more

javax.transaction.Transactional vs org.springframework.transaction.annotation.Transactional

Spring has defined its own Transactional annotation to make Spring bean methods transactional, years ago. Java EE 7 has finally done the same thing and now allows CDI bean methods to be transactional, in addition to EJB methods. So since Java EE 7, it also defines its own Transactional annotation (it obviously can’t reuse the … Read more