org.jboss.jca.adapters.jdbc.xa

## Class XAManagedConnection

- java.lang.Object
- - org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection
  - - org.jboss.jca.adapters.jdbc.xa.XAManagedConnection

- All Implemented Interfaces:
    javax.resource.spi.LocalTransaction, javax.resource.spi.ManagedConnection, javax.transaction.xa.XAResource, org.jboss.jca.core.connectionmanager.pool.mcp.NotifyingManagedConnection, org.jboss.jca.core.spi.transaction.ConnectableResource

      public class XAManagedConnection
      extends BaseWrapperManagedConnection
      implements javax.transaction.xa.XAResource, javax.resource.spi.LocalTransaction

  XAManagedConnection
  Version:
    $Revision: 76313 $
  Author:
    David Jencks , Adrian Brock, Weston Price

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected javax.transaction.xa.Xid` | `currentXid` The Xid
    `protected javax.sql.XAConnection` | `xaConnection` The XA connection
    `protected javax.transaction.xa.XAResource` | `xaResource` The XAResource

    - ### Fields inherited from class org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection

      `bundle, con, destroyed, ignoreInManagedAutoCommitCalls, inLocalTransaction, inManagedTransaction, jdbcAutoCommit, jdbcReadOnly, jdbcTransactionIsolation, mcf, metadata, props, stateLock, underlyingAutoCommit, underlyingReadOnly`

    - ### Fields inherited from interface javax.transaction.xa.XAResource

      `TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XAManagedConnection(XAManagedConnectionFactory mcf, javax.sql.XAConnection xaConnection, java.util.Properties props, int transactionIsolation, int psCacheSize)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `begin()`
    `protected void` | `broadcastConnectionError(java.sql.SQLException e)`
    `void` | `commit()`
    `void` | `commit(javax.transaction.xa.Xid xid, boolean onePhase)`
    `void` | `destroy()` Destroy
    `void` | `end(javax.transaction.xa.Xid xid, int flags)`
    `void` | `forget(javax.transaction.xa.Xid xid)`
    `javax.resource.spi.LocalTransaction` | `getLocalTransaction()`
    `int` | `getTransactionTimeout()`
    `javax.transaction.xa.XAResource` | `getXAResource()`
    `boolean` | `isSameRM(javax.transaction.xa.XAResource other)`
    `boolean` | `isXA()` Returns true if the underlying connection is handled by an XA resource manager
    `int` | `prepare(javax.transaction.xa.Xid xid)`
    `javax.transaction.xa.Xid[]` | `recover(int flag)`
    `void` | `rollback()`
    `void` | `rollback(javax.transaction.xa.Xid xid)`
    `boolean` | `setTransactionTimeout(int seconds)`
    `void` | `start(javax.transaction.xa.Xid xid, int flags)`

    - ### Methods inherited from class org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection

      `addConnectionEventListener, associateConnection, broadcastConnectionError, checkException, checkState, cleanup, getBeginRequestNotify, getConnection, getConnection, getEndRequestNotify, getLog, getLogWriter, getMetaData, getProperties, lock, notifyRequestBegin, notifyRequestEnd, removeConnectionEventListener, setBeginRequestNotify, setConnectableResourceListener, setEndRequestNotify, setLogWriter, tryLock, unlock`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### xaConnection

          protected final javax.sql.XAConnection xaConnection

      The XA connection

    - #### xaResource

          protected final javax.transaction.xa.XAResource xaResource

      The XAResource

    - #### currentXid

          protected javax.transaction.xa.Xid currentXid

      The Xid

  - ### Constructor Detail

    - #### XAManagedConnection

          public XAManagedConnection(XAManagedConnectionFactory mcf,
                                     javax.sql.XAConnection xaConnection,
                                     java.util.Properties props,
                                     int transactionIsolation,
                                     int psCacheSize)
                              throws java.sql.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:
        `java.sql.SQLException` - Thrown if an error occurs

  - ### Method Detail

    - #### begin

          public void begin()
                     throws javax.resource.ResourceException

      Specified by:
        `begin` in interface `javax.resource.spi.LocalTransaction`
      Throws:
        `javax.resource.ResourceException`

    - #### commit

          public void commit()
                      throws javax.resource.ResourceException

      Specified by:
        `commit` in interface `javax.resource.spi.LocalTransaction`
      Throws:
        `javax.resource.ResourceException`

    - #### rollback

          public void rollback()
                        throws javax.resource.ResourceException

      Specified by:
        `rollback` in interface `javax.resource.spi.LocalTransaction`
      Throws:
        `javax.resource.ResourceException`

    - #### broadcastConnectionError

          protected void broadcastConnectionError(java.sql.SQLException e)

    - #### getLocalTransaction

          public javax.resource.spi.LocalTransaction getLocalTransaction()
                                                                  throws javax.resource.ResourceException

      Specified by:
        `getLocalTransaction` in interface `javax.resource.spi.ManagedConnection`
      Throws:
        `javax.resource.ResourceException`

    - #### getXAResource

          public javax.transaction.xa.XAResource getXAResource()
                                                        throws javax.resource.ResourceException

      Specified by:
        `getXAResource` in interface `javax.resource.spi.ManagedConnection`
      Throws:
        `javax.resource.ResourceException`

    - #### destroy

          public void destroy()
                       throws javax.resource.ResourceException

      Destroy
      Specified by:
        `destroy` in interface `javax.resource.spi.ManagedConnection`
      Overrides:
        `destroy` in class `BaseWrapperManagedConnection`
      Throws:
        `javax.resource.ResourceException` - Thrown if an error occurs

    - #### start

          public void start(javax.transaction.xa.Xid xid,
                            int flags)
                     throws javax.transaction.xa.XAException

      Specified by:
        `start` in interface `javax.transaction.xa.XAResource`
      Throws:
        `javax.transaction.xa.XAException`

    - #### end

          public void end(javax.transaction.xa.Xid xid,
                          int flags)
                   throws javax.transaction.xa.XAException

      Specified by:
        `end` in interface `javax.transaction.xa.XAResource`
      Throws:
        `javax.transaction.xa.XAException`

    - #### prepare

          public int prepare(javax.transaction.xa.Xid xid)
                      throws javax.transaction.xa.XAException

      Specified by:
        `prepare` in interface `javax.transaction.xa.XAResource`
      Throws:
        `javax.transaction.xa.XAException`

    - #### commit

          public void commit(javax.transaction.xa.Xid xid,
                             boolean onePhase)
                      throws javax.transaction.xa.XAException

      Specified by:
        `commit` in interface `javax.transaction.xa.XAResource`
      Throws:
        `javax.transaction.xa.XAException`

    - #### rollback

          public void rollback(javax.transaction.xa.Xid xid)
                        throws javax.transaction.xa.XAException

      Specified by:
        `rollback` in interface `javax.transaction.xa.XAResource`
      Throws:
        `javax.transaction.xa.XAException`

    - #### forget

          public void forget(javax.transaction.xa.Xid xid)
                      throws javax.transaction.xa.XAException

      Specified by:
        `forget` in interface `javax.transaction.xa.XAResource`
      Throws:
        `javax.transaction.xa.XAException`

    - #### recover

          public javax.transaction.xa.Xid[] recover(int flag)
                                             throws javax.transaction.xa.XAException

      Specified by:
        `recover` in interface `javax.transaction.xa.XAResource`
      Throws:
        `javax.transaction.xa.XAException`

    - #### isSameRM

          public boolean isSameRM(javax.transaction.xa.XAResource other)
                           throws javax.transaction.xa.XAException

      Specified by:
        `isSameRM` in interface `javax.transaction.xa.XAResource`
      Throws:
        `javax.transaction.xa.XAException`

    - #### getTransactionTimeout

          public int getTransactionTimeout()
                                    throws javax.transaction.xa.XAException

      Specified by:
        `getTransactionTimeout` in interface `javax.transaction.xa.XAResource`
      Throws:
        `javax.transaction.xa.XAException`

    - #### setTransactionTimeout

          public boolean setTransactionTimeout(int seconds)
                                        throws javax.transaction.xa.XAException

      Specified by:
        `setTransactionTimeout` in interface `javax.transaction.xa.XAResource`
      Throws:
        `javax.transaction.xa.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

Copyright © 2014 IronJacamar (http://www.ironjacamar.org)