Basically, what it says on the tin; I need a JTA implementation useable in a Java SE application, ideally one that doesn't carry too much of a framework burden with it.
The Java Transaction API (JTA) implementation is one of the modules that make up the Transaction Service together with the Java Transaction Service (JTS) implementation. JTS enables transaction propagation and interoperability using the Internet Inter-ORB Protocol (IIOP).
Java Transaction API (JTA) specifies standard Java interfaces between a transaction manager and the parties involved in a distributed transaction system: the resource manager, the application server, and the transactional applications.
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.
In this model, Spring uses AOP over the transactional methods to provide data integrity. This is the preferred approach and works in most of the cases. Support for most of the transaction APIs such as JDBC, Hibernate, JPA, JDO, JTA etc. All we need to do is use proper transaction manager implementation class.
I recommend Bitronix. Before using any other transaction manager, I recommend thorough testing. Tests like killing power to various machines during each phase of the transaction. You want transactionality to protect you when failures occur. It is surprising how many transaction managers have failed to correctly implement recovery.
Bitronix does need JNDI, which is typically provided for you in a Java EE container, but they include a simple embedded implementation that will support Bitronix in a Java SE application.
If 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