Class XAManagedConnection

java.lang.Object
org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection
org.jboss.jca.adapters.jdbc.xa.XAManagedConnection
All Implemented Interfaces:
jakarta.resource.spi.LocalTransaction, jakarta.resource.spi.ManagedConnection, XAResource, org.jboss.jca.core.connectionmanager.pool.mcp.NotifyingManagedConnection, ConnectableResource

public class XAManagedConnection extends BaseWrapperManagedConnection implements XAResource, jakarta.resource.spi.LocalTransaction
XAManagedConnection
Version:
$Revision: 76313 $
Author:
David Jencks , Adrian Brock, Weston Price
  • Field Details

    • xaConnection

      protected final XAConnection xaConnection
      The XA connection
    • xaResource

      protected final XAResource xaResource
      The XAResource
    • currentXid

      protected Xid currentXid
      The Xid
  • Constructor Details

    • XAManagedConnection

      public XAManagedConnection(XAManagedConnectionFactory mcf, XAConnection xaConnection, Properties props, int transactionIsolation, int psCacheSize) throws SQLException
      Constructor
      Parameters:
      mcf - The managed connection factory
      xaConnection - The XA connection
      props - The properties
      transactionIsolation - The transaction isolation
      psCacheSize - The prepared statement cache size
      Throws:
      SQLException - Thrown if an error occurs
  • Method Details

    • begin

      public void begin() throws jakarta.resource.ResourceException
      Specified by:
      begin in interface jakarta.resource.spi.LocalTransaction
      Throws:
      jakarta.resource.ResourceException
    • commit

      public void commit() throws jakarta.resource.ResourceException
      Specified by:
      commit in interface jakarta.resource.spi.LocalTransaction
      Throws:
      jakarta.resource.ResourceException
    • rollback

      public void rollback() throws jakarta.resource.ResourceException
      Specified by:
      rollback in interface jakarta.resource.spi.LocalTransaction
      Throws:
      jakarta.resource.ResourceException
    • broadcastConnectionError

      protected void broadcastConnectionError(SQLException e)
    • getLocalTransaction

      public jakarta.resource.spi.LocalTransaction getLocalTransaction() throws jakarta.resource.ResourceException
      Specified by:
      getLocalTransaction in interface jakarta.resource.spi.ManagedConnection
      Throws:
      jakarta.resource.ResourceException
    • getXAResource

      public XAResource getXAResource() throws jakarta.resource.ResourceException
      Specified by:
      getXAResource in interface jakarta.resource.spi.ManagedConnection
      Throws:
      jakarta.resource.ResourceException
    • destroy

      public void destroy() throws jakarta.resource.ResourceException
      Destroy
      Specified by:
      destroy in interface jakarta.resource.spi.ManagedConnection
      Overrides:
      destroy in class BaseWrapperManagedConnection
      Throws:
      jakarta.resource.ResourceException - Thrown if an error occurs
    • start

      public void start(Xid xid, int flags) throws XAException
      Specified by:
      start in interface XAResource
      Throws:
      XAException
    • end

      public void end(Xid xid, int flags) throws XAException
      Specified by:
      end in interface XAResource
      Throws:
      XAException
    • prepare

      public int prepare(Xid xid) throws XAException
      Specified by:
      prepare in interface XAResource
      Throws:
      XAException
    • commit

      public void commit(Xid xid, boolean onePhase) throws XAException
      Specified by:
      commit in interface XAResource
      Throws:
      XAException
    • rollback

      public void rollback(Xid xid) throws XAException
      Specified by:
      rollback in interface XAResource
      Throws:
      XAException
    • forget

      public void forget(Xid xid) throws XAException
      Specified by:
      forget in interface XAResource
      Throws:
      XAException
    • recover

      public Xid[] recover(int flag) throws XAException
      Specified by:
      recover in interface XAResource
      Throws:
      XAException
    • isSameRM

      public boolean isSameRM(XAResource other) throws XAException
      Specified by:
      isSameRM in interface XAResource
      Throws:
      XAException
    • getTransactionTimeout

      public int getTransactionTimeout() throws XAException
      Specified by:
      getTransactionTimeout in interface XAResource
      Throws:
      XAException
    • setTransactionTimeout

      public boolean setTransactionTimeout(int seconds) throws XAException
      Specified by:
      setTransactionTimeout in interface XAResource
      Throws:
      XAException
    • isXA

      public boolean isXA()
      Returns true if the underlying connection is handled by an XA resource manager
      Specified by:
      isXA in class BaseWrapperManagedConnection
      Returns:
      The value