Representation of a transaction within JPOX. This interface is not user application visible. Handling of transactions in JPOX is split in 4 layers:
API - The User Visible Transaction API
ObjectManager Transaction - The Transaction assigned to a ObjectManager
X/Open/JTA - The Transaction Manager associated to the underlying datastore transaction
Resource - The Transaction handled by the datastore
In the the API layer, there are interfaces provided to the user application, as such:
{@link javax.jdo.Transaction} - the JDO API interface
javax.persistence.EntityTransaction - the JPA API interface
{@link javax.transaction.UserTransaction} - the JTA API interface
{@link org.jpox.UserTransaction} - JPOX API proprietary API
In the ObjectManager layer, the {@link org.jpox.Transaction} interface defines the contractfor handling transactions for the ObjectManager. In the X/Open/JTA layer the handling of XA resources is done. It means, XAResources are obtained and enlisted to a TransactionManager. The TransactionManager will commit or rollback the resources at the end of the transactions. There are two kinds of TransactionManager: JPOX and JTA. A JTA TransactionManager is external to JPOX, while the JPOX TransactionManager is implemented by JPOX as {@link org.jpox.transaction}. The JPOX TransactionManager is used when the DataSource used to obtain connections to the underlying database is not enlisted in an external JTA TransactionManager. The JTA TransactionManager is usually found when running in J2EE application servers, however nowadays there are many JTA containers that can be used in J2SE. The scenarios where a JTA TransactionManager is used is: When an JTA TransactionManager exists, and the connections to the underlying databases are acquired via transactional DataSources. That means, when you ask a connection to the DataSource, it will automatically enlist it in a JTA TransactionManager. The Resource layer is handled by the datastore. For example, with RDBMS databases, the javax.sql.Connection is the API used to demarcate the database transactions. In The RBDMS database, the resource layer, it is handling the database transaction.
@version $Revision: 1.27 $