Enlisting XA resources with Transaction Manager

When EAServer is running in two-phase commit mode, which is the default for version 5.0 or later, you can enlist XA resources with EAServer Transaction Manager.

StepsEnlisting XA resources

To enlist an XA resource into a current EAServer transaction:

  1. Get the instance of Transaction Manager:

    javax.transaction.TransactionManager tm = com.sun.jts.jta.TransactionManager.getTransactionManagerImpl();
    
  2. Get the instance of the transaction:

    javax.transaction.Transaction trans = tm.getTransaction();
    
  3. Register the XA resource with the transaction:

    trans.enlistResource(xaresource);
    

EAServer manages this XA resource with respect to its transaction boundaries.