Name

XAResource

Synopsis

The XAResource interface is implemented by shared resources that want to engage in distributed transactions. A single resource manager (e.g., a database server or message service) can export multiple transactional resources (database connections, sessions with a message service), represented as XAResources. The transaction manager uses the XAResource interface to associate a resource with a transaction, using the start() method, to ask the resource to commit() or rollback() any work done while it was associated with a transaction, and finally to end() the association with a transaction. Other methods on XAResource are used to manage the association of the resource with the transaction context.

public interface XAResource {
// Public Constants
   public static final int TMENDRSCAN;                           // =8388608
   public static final int TMFAIL;                               // =536870912
   public static final int TMJOIN;                               // =2097152
   public static final int TMNOFLAGS;                            // =0
   public static final int TMONEPHASE;                           // =1073741824
   public static final int TMRESUME;                             // =134217728
   public static final int TMSTARTRSCAN;                         // =16777216
   public static final int TMSUCCESS;                            // =67108864
   public static final int TMSUSPEND;                            // =33554432
   public static final int XA_OK;                                // =0
   public static final int XA_RDONLY;                            // =3
                  // Public Instance Methods
   public abstract void commit(Xid xid, 
        boolean onePhase) throws XAException;  
   public abstract void end(Xid xid, 
        int flags) throws XAException;  
   public abstract void forget( Xid xid) throws XAException; ...

Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.