Resource manager  Chapter 3: Managing Applications and Packages in EAServer Manager

Chapter 2: Understanding Transactions and Component Lifecycles

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.





Copyright © 2005. Sybase Inc. All rights reserved. Chapter 3: Managing Applications and Packages in EAServer Manager

View this book as PDF