com.atomikos.jdbc
Class ExclusiveExternalXAPooledConnectionImp

java.lang.Object
  extended by com.atomikos.jdbc.ExternalXAPooledConnectionImp
      extended by com.atomikos.jdbc.ExclusiveExternalXAPooledConnectionImp
All Implemented Interfaces:
Synchronization, DTPPooledConnection, XPooledConnection, Serializable, EventListener, ConnectionEventListener, PooledConnection

public class ExclusiveExternalXAPooledConnectionImp
extends ExternalXAPooledConnectionImp
implements Synchronization

A non-shared implementation of a pooled connection. Some DBs such as Oracle or SQLServer deviate from the standard in the moment where an XAResource can be reused. This has to be AFTER 2PC (contrary to standard). Instances of this class will generate TWO close events, and only the second will have isDiscarded set to true.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.atomikos.jdbc.ExternalXAPooledConnectionImp
connectionProxy_, creationTime_, discarded_, invalidated_, lastUse_, listeners_, logWriter_, msg_, myConn_, resource_, restx_
 
Constructor Summary
ExclusiveExternalXAPooledConnectionImp(XAConnection c, TransactionalResource res)
           
ExclusiveExternalXAPooledConnectionImp(XAConnection c, TransactionalResource res, PrintWriter logWriter)
           
 
Method Summary
 void afterCompletion(Object state)
          Called after the overall outcome is known.
 void beforeCompletion()
          Called before prepare decision is made.
 void connectionClosed(ConnectionEvent e)
           
 void setResourceTransaction(ResourceTransaction restx)
          Associate a resource transaction with this connection.
 
Methods inherited from class com.atomikos.jdbc.ExternalXAPooledConnectionImp
addConnectionEventListener, close, connectionErrorOccurred, getConnection, getConnection, getInvalidated, getLastUse, getTransactionalResource, isDiscarded, isInResourceTransaction, removeConnectionEventListener, setDiscarded, setInvalidated, setLastUse, suspendResourceTransaction, toString, unsetResourceTransaction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExclusiveExternalXAPooledConnectionImp

public ExclusiveExternalXAPooledConnectionImp(XAConnection c,
                                              TransactionalResource res)

ExclusiveExternalXAPooledConnectionImp

public ExclusiveExternalXAPooledConnectionImp(XAConnection c,
                                              TransactionalResource res,
                                              PrintWriter logWriter)
Method Detail

setResourceTransaction

public void setResourceTransaction(ResourceTransaction restx)
                            throws SQLException
Description copied from interface: DTPPooledConnection
Associate a resource transaction with this connection. After returning, the resource transaction should be ready for resume() calls.

Specified by:
setResourceTransaction in interface DTPPooledConnection
Overrides:
setResourceTransaction in class ExternalXAPooledConnectionImp
Parameters:
restx - The resource transaction to be associated with this connection.
Throws:
SQLException - If a SQL error occurs.

beforeCompletion

public void beforeCompletion()
Description copied from interface: Synchronization
Called before prepare decision is made.

Specified by:
beforeCompletion in interface Synchronization

afterCompletion

public void afterCompletion(Object state)
Description copied from interface: Synchronization
Called after the overall outcome is known.

Specified by:
afterCompletion in interface Synchronization
Parameters:
state - The state of the coordinator after preparing. Equals either null ( readonly ), TxState.COMMITTING or TxState.ABORTING.

connectionClosed

public void connectionClosed(ConnectionEvent e)
Specified by:
connectionClosed in interface ConnectionEventListener
Overrides:
connectionClosed in class ExternalXAPooledConnectionImp


Copyright © 2011. All Rights Reserved.