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

public Class JDBCXAConnectionWrapper

extends JDBCConnection
Class Inheritance
Imports
org.hsqldb.jdbc.JDBCConnection, java.sql.SQLException, .Savepoint

This is a wrapper class for JDBCConnection objects (not java.sql.XAConnection objects). Purpose of this class is to intercept and handle XA-related operations according to chapter 12 of the JDBC 3.0 specification, by returning this wrapped JDBCConnection to end-users. Global transaction services and XAResources will not use this wrapper.

The new implementation extends JDBCConnection. A new object is created based on the session / session proxy of the JDBCXAConnection object in the constructor. (fredt)

Author
Blaine Simpson (blaine dot simpson at admc dot com)
Since
HSQLDB 2.0.0
Version
2.2.9
See Also
org.hsqldb.jdbc.JDBCConnection

Field Summary

Modifier and TypeField and Description
private JDBCXAResource
Inherited from org.hsqldb.jdbc.JDBCConnection:
isNetConn

Constructor Summary

AccessConstructor and Description
public
JDBCXAConnectionWrapper(JDBCXAResource xaResource, JDBCXAConnection xaConnection, JDBCConnection databaseConnection)

Method Summary

Modifier and TypeMethod and Description
public void
commit()

Overrides org.hsqldb.jdbc.JDBCConnection.commit.

Implements java.sql.Connection.commit.

Interceptor method, because this method is prohibited within any global transaction.

public void
rollback()

Overrides org.hsqldb.jdbc.JDBCConnection.rollback.

Implements java.sql.Connection.rollback.

Interceptor method, because this method is prohibited within any global transaction.

public void
rollback(Savepoint savepoint)

Overrides org.hsqldb.jdbc.JDBCConnection.rollback.

Implements java.sql.Connection.rollback.

Interceptor method, because this method is prohibited within any global transaction.

public void
setAutoCommit(boolean
mode
autoCommit
)

Overrides org.hsqldb.jdbc.JDBCConnection.setAutoCommit.

Implements java.sql.Connection.setAutoCommit.

Interceptor method, because this method is prohibited within any global transaction.

public Savepoint
setSavepoint()

Overrides org.hsqldb.jdbc.JDBCConnection.setSavepoint.

Implements java.sql.Connection.setSavepoint.

Interceptor method, because this method is prohibited within any global transaction.

public Savepoint
setSavepoint(String name)

Overrides org.hsqldb.jdbc.JDBCConnection.setSavepoint.

Implements java.sql.Connection.setSavepoint.

Interceptor method, because this method is prohibited within any global transaction.

public void
setTransactionIsolation(int
isolation level
level
)

Overrides org.hsqldb.jdbc.JDBCConnection.setTransactionIsolation.

Implements java.sql.Connection.setTransactionIsolation.

Interceptor method, because there may be XA implications to calling the method within a global transaction.

private void
validateNotWithinTransaction()

Throws a SQLException if within a Global transaction.

Inherited from org.hsqldb.jdbc.JDBCConnection:
abortbeginRequestclearWarningsclosecloseFullycreateArrayOfcreateBlobcreateClobcreateNClobcreateSQLXMLcreateStatementcreateStatementcreateStatementcreateStructendRequestgetAutoCommitgetCataloggetClientInfogetClientInfogetConnPropertiesgetHoldabilitygetMetaDatagetNetworkTimeoutgetSchemagetSessiongetTransactionIsolationgetTypeMapgetURLgetWarningsisClosedisInternalisNetworkisReadOnlyisValidisWrapperFornativeSQLprepareCallprepareCallprepareCallprepareStatementprepareStatementprepareStatementprepareStatementprepareStatementprepareStatementreleaseSavepointresetsetCatalogsetClientInfosetClientInfosetHoldabilitysetNetworkTimeoutsetReadOnlysetSchemasetTypeMapunwrap

Field Detail

xaResourceback to summary
private JDBCXAResource xaResource

Constructor Detail

JDBCXAConnectionWrapperback to summary
public JDBCXAConnectionWrapper(JDBCXAResource xaResource, JDBCXAConnection xaConnection, JDBCConnection databaseConnection) throws SQLException

Method Detail

commitback to summary
public void commit() throws SQLException

Overrides org.hsqldb.jdbc.JDBCConnection.commit.

Implements java.sql.Connection.commit.

Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.

Exceptions
SQLException:
on error
rollbackback to summary
public void rollback() throws SQLException

Overrides org.hsqldb.jdbc.JDBCConnection.rollback.

Implements java.sql.Connection.rollback.

Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.

Exceptions
SQLException:
on error
rollbackback to summary
public void rollback(Savepoint savepoint) throws SQLException

Overrides org.hsqldb.jdbc.JDBCConnection.rollback.

Implements java.sql.Connection.rollback.

Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.

Exceptions
SQLException:
on error
setAutoCommitback to summary
public void setAutoCommit(boolean autoCommit) throws SQLException

Overrides org.hsqldb.jdbc.JDBCConnection.setAutoCommit.

Implements java.sql.Connection.setAutoCommit.

Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.

Parameters
autoCommit:boolean

mode

Exceptions
SQLException:
on error
setSavepointback to summary
public Savepoint setSavepoint() throws SQLException

Overrides org.hsqldb.jdbc.JDBCConnection.setSavepoint.

Implements java.sql.Connection.setSavepoint.

Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.

Exceptions
SQLException:
on error
setSavepointback to summary
public Savepoint setSavepoint(String name) throws SQLException

Overrides org.hsqldb.jdbc.JDBCConnection.setSavepoint.

Implements java.sql.Connection.setSavepoint.

Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.

Exceptions
SQLException:

Doc from org.hsqldb.jdbc.JDBCConnection.setSavepoint.

if a database access error occurs, this method is called while participating in a distributed transaction, this method is called on a closed connection or this Connection object is currently in auto-commit mode

setTransactionIsolationback to summary
public void setTransactionIsolation(int level) throws SQLException

Overrides org.hsqldb.jdbc.JDBCConnection.setTransactionIsolation.

Implements java.sql.Connection.setTransactionIsolation.

Interceptor method, because there may be XA implications to calling the method within a global transaction. See section 1.2.4 of the JDBC 3.0 spec.

HSQLDB does not allow changing the isolation level inside a transaction of any kind.

Parameters
level:int

isolation level

Exceptions
SQLException:

Doc from org.hsqldb.jdbc.JDBCConnection.setTransactionIsolation.

if a database access error occurs, this method is called on a closed connection or the given parameter is not one of the Connection constants

validateNotWithinTransactionback to summary
private void validateNotWithinTransaction() throws SQLException

Throws a SQLException if within a Global transaction.

Exceptions
SQLException:
if within a Global transaction.