|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbitronix.tm.resource.common.AbstractXAStatefulHolder
bitronix.tm.resource.common.AbstractXAResourceHolder
bitronix.tm.resource.jdbc.JdbcPooledConnection
public class JdbcPooledConnection
Implementation of a JDBC pooled connection wrapping vendor's XAConnection
implementation.
Field Summary |
---|
Fields inherited from interface bitronix.tm.resource.common.XAStatefulHolder |
---|
STATE_ACCESSIBLE, STATE_CLOSED, STATE_IN_POOL, STATE_NOT_ACCESSIBLE |
Constructor Summary | |
---|---|
JdbcPooledConnection(PoolingDataSource poolingDataSource,
javax.sql.XAConnection xaConnection)
|
Method Summary | |
---|---|
void |
close()
Close the physical connection that this XAStatefulHolder represents. |
RecoveryXAResourceHolder |
createRecoveryXAResourceHolder()
|
java.util.Date |
getAcquisitionDate()
|
protected java.sql.PreparedStatement |
getCachedStatement(java.lang.String sql)
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()
|
java.lang.String |
getStateDescription()
|
java.lang.String |
getTransactionGtridCurrentlyHoldingThis()
|
javax.transaction.xa.XAResource |
getXAResource()
Get the vendor's XAResource implementation of the wrapped resource. |
java.util.List |
getXAResourceHolders()
Get the list of XAResourceHolder s created by this
XAStatefulHolder that are still open. |
protected java.sql.PreparedStatement |
putCachedStatement(java.lang.String sql,
java.sql.PreparedStatement 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()
|
Methods inherited from class bitronix.tm.resource.common.AbstractXAResourceHolder |
---|
getXAResourceHolderState, hasStateForXAResource, isParticipatingInActiveGlobalTransaction, removeXAResourceHolderState, setXAResourceHolderState |
Methods inherited from class bitronix.tm.resource.common.AbstractXAStatefulHolder |
---|
addStateChangeEventListener, getState, removeStateChangeEventListener, setState |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface bitronix.tm.resource.common.XAStatefulHolder |
---|
addStateChangeEventListener, getState, removeStateChangeEventListener, setState |
Constructor Detail |
---|
public JdbcPooledConnection(PoolingDataSource poolingDataSource, javax.sql.XAConnection xaConnection) throws java.sql.SQLException
java.sql.SQLException
Method Detail |
---|
public void close() throws java.sql.SQLException
XAStatefulHolder
XAStatefulHolder
represents.
close
in interface XAStatefulHolder
java.sql.SQLException
public RecoveryXAResourceHolder createRecoveryXAResourceHolder()
protected void release() throws java.sql.SQLException
java.sql.SQLException
public javax.transaction.xa.XAResource getXAResource()
XAResourceHolder
XAResource
implementation of the wrapped resource.
getXAResource
in interface XAResourceHolder
public PoolingDataSource getPoolingDataSource()
public java.util.List getXAResourceHolders()
XAStatefulHolder
XAResourceHolder
s created by this
XAStatefulHolder
that are still open.
This method is thread-safe.
getXAResourceHolders
in interface XAStatefulHolder
XAResourceHolder
s created by this
XAStatefulHolder
that are still open.public java.lang.Object getConnectionHandle() throws java.lang.Exception
XAStatefulHolder
XAStatefulHolder
.
This method is thread-safe.
getConnectionHandle
in interface XAStatefulHolder
java.lang.Exception
- a resource-specific exception thrown when the disaposable connection cannot be created.public void stateChanged(XAStatefulHolder source, int oldState, int newState)
StateChangeListener
XAStatefulHolder
has changed.
stateChanged
in interface StateChangeListener
source
- 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)
StateChangeListener
XAStatefulHolder
has changed.
stateChanging
in interface StateChangeListener
source
- the XAStatefulHolder
changing state.currentState
- the current state of the XAStatefulHolder
.futureState
- the future state of the XAStatefulHolder
.protected java.sql.PreparedStatement getCachedStatement(java.lang.String sql)
sql
- the key that has been used to cache the statement.
protected java.sql.PreparedStatement putCachedStatement(java.lang.String sql, java.sql.PreparedStatement stmt)
sql
- the key that is used to cache the statement.stmt
- the statement to cache.
protected java.sql.Statement registerUncachedStatement(java.sql.Statement stmt)
stmt
- the statement to register.
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getStateDescription()
getStateDescription
in interface JdbcPooledConnectionMBean
public java.util.Date getAcquisitionDate()
getAcquisitionDate
in interface JdbcPooledConnectionMBean
public java.util.Date getLastReleaseDate()
XAStatefulHolder
getLastReleaseDate
in interface XAStatefulHolder
public java.lang.String getTransactionGtridCurrentlyHoldingThis()
getTransactionGtridCurrentlyHoldingThis
in interface JdbcPooledConnectionMBean
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |