Top Description Fields Constructors Methods
org.hsqldb.jdbc.pool

public Class JDBCXAConnection

extends JDBCPooledConnection
implements XAConnection
Class Inheritance
All Implemented Interfaces
javax.sql.XAConnection, javax.sql.PooledConnection
Imports
java.sql.Connection, .SQLException, javax.sql.XAConnection, javax.transaction.xa.XAResource, org.hsqldb.jdbc.JDBCConnection

Subclass of JDBCPooledConnection implements the XAConnection interface. For use by global transaction service managers.

Each instance has an JDBCXAResource inherits the superclass's two JDBCConnection objects, one for internal access, and one for user access.

The getConnection() method returns a user connection and links this with the JDBCXAResource. This puts the object in the inUse state. When the user connection is closed, the object is put in the free state.

Author
Fred Toussi (fredt at users.sourceforge.net)
Since
HSQLDB 2.0
Version
2.2.9
See Also
javax.sql.XAConnection

Field Summary

Modifier and TypeField and Description
pack-priv JDBCXAResource
Inherited from org.hsqldb.jdbc.pool.JDBCPooledConnection:
connectionisInUselistenersuserConnection

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides org.hsqldb.jdbc.pool.JDBCPooledConnection.close.

Implements javax.sql.PooledConnection.close.

Closes the physical connection that this PooledConnection object represents.

public synchronized Connection

Returns:

Connection
getConnection
()

Overrides org.hsqldb.jdbc.pool.JDBCPooledConnection.getConnection.

Implements javax.sql.PooledConnection.getConnection.

Returns a connection that can be used by the user application.

public XAResource
getXAResource()

Implements javax.sql.XAConnection.getXAResource.

Retrieves an XAResource object that the transaction manager will use to manage this XAConnection object's participation in a distributed transaction.

Inherited from org.hsqldb.jdbc.pool.JDBCPooledConnection:
addConnectionEventListeneraddStatementEventListenerconnectionClosedconnectionErrorOccurredisInUsereleaseremoveConnectionEventListenerremoveStatementEventListenerreset

Field Detail

xaResourceback to summary
pack-priv JDBCXAResource xaResource

Constructor Detail

JDBCXAConnectionback to summary
public JDBCXAConnection(JDBCXADataSource dataSource, JDBCConnection connection)

Method Detail

closeback to summary
public void close() throws SQLException

Overrides org.hsqldb.jdbc.pool.JDBCPooledConnection.close.

Implements javax.sql.PooledConnection.close.

Doc from javax.sql.PooledConnection.close.

Closes the physical connection that this PooledConnection object represents. An application never calls this method directly; it is called by the connection pool module, or manager.

See the interface description for more information.

Exceptions
SQLException:
if a database access error occurs
getConnectionback to summary
public synchronized Connection getConnection() throws SQLException

Overrides org.hsqldb.jdbc.pool.JDBCPooledConnection.getConnection.

Implements javax.sql.PooledConnection.getConnection.

Returns a connection that can be used by the user application.

Returns:Connection

Connection

Exceptions
SQLException:
if a lease has already been given on this connection
getXAResourceback to summary
public XAResource getXAResource() throws SQLException

Implements javax.sql.XAConnection.getXAResource.

Doc from javax.sql.XAConnection.getXAResource.

Retrieves an XAResource object that the transaction manager will use to manage this XAConnection object's participation in a distributed transaction.

Exceptions
SQLException:
if a database access error occurs