public class JdbcPooledConnection extends AbstractXAResourceHolder implements StateChangeListener, JdbcPooledConnectionMBean
XAConnection implementation.STATE_ACCESSIBLE, STATE_CLOSED, STATE_IN_POOL, STATE_NOT_ACCESSIBLE| Constructor and Description |
|---|
JdbcPooledConnection(PoolingDataSource poolingDataSource,
javax.sql.XAConnection xaConnection) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the physical connection that this
XAStatefulHolder represents. |
RecoveryXAResourceHolder |
createRecoveryXAResourceHolder() |
java.util.Date |
getAcquisitionDate() |
protected JdbcPreparedStatementHandle |
getCachedStatement(JdbcPreparedStatementHandle stmt)
Get a PreparedStatement from cache.
|
java.lang.Object |
getConnectionHandle()
Create a disposable handler used to drive a pooled instance of
XAStatefulHolder. |
java.util.Date |
getLastReleaseDate()
Get the date at which this object was last released to the pool.
|
PoolingDataSource |
getPoolingDataSource() |
ResourceBean |
getResourceBean()
Get the ResourceBean which created this XAResourceHolder.
|
java.lang.String |
getStateDescription() |
java.util.Collection |
getTransactionGtridsCurrentlyHoldingThis() |
javax.sql.XAConnection |
getXaConnection() |
javax.transaction.xa.XAResource |
getXAResource()
Get the vendor's
XAResource implementation of the wrapped resource. |
java.util.List<XAResourceHolder> |
getXAResourceHolders()
Get the list of
XAResourceHolders created by this
XAStatefulHolder that are still open. |
protected JdbcPreparedStatementHandle |
putCachedStatement(JdbcPreparedStatementHandle stmt)
Put a PreparedStatement in the cache.
|
protected java.sql.Statement |
registerUncachedStatement(java.sql.Statement stmt)
Register uncached statement so that it can be closed when the connection is put back in the pool.
|
protected void |
release() |
void |
stateChanged(XAStatefulHolder source,
int oldState,
int newState)
Fired when the internal state of a
XAStatefulHolder has changed. |
void |
stateChanging(XAStatefulHolder source,
int currentState,
int futureState)
Fired before the internal state of a
XAStatefulHolder has changed. |
java.lang.String |
toString() |
protected void |
unregisterUncachedStatement(java.sql.Statement stmt) |
getXAResourceHolderStateGtrids, getXAResourceHolderStatesForGtrid, hasStateForXAResource, isParticipatingInActiveGlobalTransaction, putXAResourceHolderState, removeXAResourceHolderStateaddStateChangeEventListener, getState, removeStateChangeEventListener, setStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddStateChangeEventListener, getState, removeStateChangeEventListener, setStatepublic JdbcPooledConnection(PoolingDataSource poolingDataSource, javax.sql.XAConnection xaConnection) throws java.sql.SQLException
java.sql.SQLExceptionpublic void close()
throws java.sql.SQLException
XAStatefulHolderXAStatefulHolder represents.close in interface XAStatefulHolderjava.sql.SQLExceptionpublic RecoveryXAResourceHolder createRecoveryXAResourceHolder()
protected void release()
throws java.sql.SQLException
java.sql.SQLExceptionpublic javax.transaction.xa.XAResource getXAResource()
XAResourceHolderXAResource implementation of the wrapped resource.getXAResource in interface XAResourceHolderpublic ResourceBean getResourceBean()
XAResourceHoldergetResourceBean in interface XAResourceHolderpublic PoolingDataSource getPoolingDataSource()
public java.util.List<XAResourceHolder> getXAResourceHolders()
XAStatefulHolderXAResourceHolders created by this
XAStatefulHolder that are still open.
This method is thread-safe.
getXAResourceHolders in interface XAStatefulHolderXAResourceHolders created by this
XAStatefulHolder that are still open.public java.lang.Object getConnectionHandle()
throws java.lang.Exception
XAStatefulHolderXAStatefulHolder.
This method is thread-safe.
getConnectionHandle in interface XAStatefulHolderjava.lang.Exception - a resource-specific exception thrown when the disaposable connection cannot be created.public void stateChanged(XAStatefulHolder source, int oldState, int newState)
StateChangeListenerXAStatefulHolder has changed.stateChanged in interface StateChangeListenersource - the XAStatefulHolder changing state.oldState - the old state of the XAStatefulHolder.newState - the new state of the XAStatefulHolder.public void stateChanging(XAStatefulHolder source, int currentState, int futureState)
StateChangeListenerXAStatefulHolder has changed.stateChanging in interface StateChangeListenersource - the XAStatefulHolder changing state.currentState - the current state of the XAStatefulHolder.futureState - the future state of the XAStatefulHolder.protected JdbcPreparedStatementHandle getCachedStatement(JdbcPreparedStatementHandle stmt)
stmt - the key that has been used to cache the statement.protected JdbcPreparedStatementHandle putCachedStatement(JdbcPreparedStatementHandle stmt)
stmt - the statement to cache.protected java.sql.Statement registerUncachedStatement(java.sql.Statement stmt)
stmt - the statement to register.protected void unregisterUncachedStatement(java.sql.Statement stmt)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getStateDescription()
getStateDescription in interface JdbcPooledConnectionMBeanpublic java.util.Date getAcquisitionDate()
getAcquisitionDate in interface JdbcPooledConnectionMBeanpublic java.util.Date getLastReleaseDate()
XAStatefulHoldergetLastReleaseDate in interface XAStatefulHolderpublic java.util.Collection getTransactionGtridsCurrentlyHoldingThis()
getTransactionGtridsCurrentlyHoldingThis in interface JdbcPooledConnectionMBeanpublic javax.sql.XAConnection getXaConnection()
Copyright © 2006-2023 Bitronix Software. All Rights Reserved.