Class JDBCXAConnectionWrapper
java.lang.Object
org.hsqldb.jdbc.JDBCConnection
org.hsqldb.jdbc.pool.JDBCXAConnectionWrapper
- All Implemented Interfaces:
AutoCloseable, Connection, Wrapper
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)
- Since:
- HSQLDB 2.0.0
- Author:
- Blaine Simpson (blaine dot simpson at admc dot com)
- See Also:
-
Field Summary
Fields inherited from interface Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE -
Constructor Summary
ConstructorsConstructorDescriptionJDBCXAConnectionWrapper(JDBCXAResource xaResource, JDBCXAConnection xaConnection, JDBCConnection databaseConnection) -
Method Summary
Modifier and TypeMethodDescriptionvoidcommit()Interceptor method, because this method is prohibited within any global transaction.voidrollback()Interceptor method, because this method is prohibited within any global transaction.voidInterceptor method, because this method is prohibited within any global transaction.voidsetAutoCommit(boolean autoCommit) Interceptor method, because this method is prohibited within any global transaction.Interceptor method, because this method is prohibited within any global transaction.setSavepoint(String name) Interceptor method, because this method is prohibited within any global transaction.voidsetTransactionIsolation(int level) Interceptor method, because there may be XA implications to calling the method within a global transaction.Methods inherited from class JDBCConnection
abort, beginRequest, clearWarnings, close, closeFully, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, endRequest, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getConnProperties, getHoldability, getMetaData, getNetworkTimeout, getSchema, getSession, getTransactionIsolation, getTypeMap, getURL, getWarnings, isClosed, isInternal, isNetwork, isReadOnly, isValid, isWrapperFor, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, reset, setCatalog, setClientInfo, setClientInfo, setHoldability, setNetworkTimeout, setReadOnly, setSchema, setTypeMap, unwrapMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Connection
setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
Constructor Details
-
JDBCXAConnectionWrapper
public JDBCXAConnectionWrapper(JDBCXAResource xaResource, JDBCXAConnection xaConnection, JDBCConnection databaseConnection) throws SQLException - Throws:
SQLException
-
-
Method Details
-
setAutoCommit
Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.- Specified by:
setAutoCommitin interfaceConnection- Overrides:
setAutoCommitin classJDBCConnection- Parameters:
autoCommit- mode- Throws:
SQLException- on error- See Also:
-
commit
Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.- Specified by:
commitin interfaceConnection- Overrides:
commitin classJDBCConnection- Throws:
SQLException- on error- See Also:
-
rollback
Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.- Specified by:
rollbackin interfaceConnection- Overrides:
rollbackin classJDBCConnection- Throws:
SQLException- on error- See Also:
-
rollback
Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.- Specified by:
rollbackin interfaceConnection- Overrides:
rollbackin classJDBCConnection- Parameters:
savepoint- theSavepointobject to roll back to- Throws:
SQLException- on error- See Also:
-
setSavepoint
Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.- Specified by:
setSavepointin interfaceConnection- Overrides:
setSavepointin classJDBCConnection- Returns:
- the new
Savepointobject - Throws:
SQLException- on error- See Also:
-
setSavepoint
Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.- Specified by:
setSavepointin interfaceConnection- Overrides:
setSavepointin classJDBCConnection- Parameters:
name- aStringcontaining the name of the savepoint- Returns:
- the new
Savepointobject - Throws:
SQLException- 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 thisConnectionobject is currently in auto-commit mode- See Also:
-
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.
- Specified by:
setTransactionIsolationin interfaceConnection- Overrides:
setTransactionIsolationin classJDBCConnection- Parameters:
level- isolation level- Throws:
SQLException- if a database access error occurs, this method is called on a closed connection or the given parameter is not one of theConnectionconstants- See Also:
-