org.hsqldb.jdbc.pool
Class JDBCXAConnectionWrapper
- java.lang.Object
-
- org.hsqldb.jdbc.JDBCConnection
-
- org.hsqldb.jdbc.pool.JDBCXAConnectionWrapper
-
- All Implemented Interfaces:
- java.lang.AutoCloseable, java.sql.Connection, java.sql.Wrapper
public class JDBCXAConnectionWrapper extends JDBCConnection
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:
- 2.0.0
- See Also:
JDBCConnection
-
-
Constructor Summary
Constructors Constructor and Description JDBCXAConnectionWrapper(JDBCXAResource xaResource, JDBCXAConnection xaConnection, JDBCConnection databaseConnection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcommit()Interceptor method, because this method is prohibited within any global transaction.voidrollback()Interceptor method, because this method is prohibited within any global transaction.voidrollback(java.sql.Savepoint savepoint)Interceptor method, because this method is prohibited within any global transaction.voidsetAutoCommit(boolean autoCommit)Interceptor method, because this method is prohibited within any global transaction.java.sql.SavepointsetSavepoint()Interceptor method, because this method is prohibited within any global transaction.java.sql.SavepointsetSavepoint(java.lang.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 org.hsqldb.jdbc.JDBCConnection
abort, clearWarnings, close, closeFully, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getNetworkTimeout, getSchema, getSession, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, isValid, isWrapperFor, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, reset, setCatalog, setClientInfo, setClientInfo, setHoldability, setNetworkTimeout, setReadOnly, setSchema, setTypeMap, unwrap
-
-
-
-
Constructor Detail
-
JDBCXAConnectionWrapper
public JDBCXAConnectionWrapper(JDBCXAResource xaResource, JDBCXAConnection xaConnection, JDBCConnection databaseConnection) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-
Method Detail
-
setAutoCommit
public void setAutoCommit(boolean autoCommit) throws java.sql.SQLExceptionInterceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.- Specified by:
setAutoCommitin interfacejava.sql.Connection- Overrides:
setAutoCommitin classJDBCConnection- Parameters:
autoCommit-trueto enable auto-commit mode;falseto disable it- Throws:
java.sql.SQLException- if a database access error occurs, (JDBC4 Clarification:) setAutoCommit(true) is called while participating in a distributed transaction, or this method is called on a closed connection- See Also:
JDBCConnection.getAutoCommit()
-
commit
public void commit() throws java.sql.SQLExceptionInterceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.- Specified by:
commitin interfacejava.sql.Connection- Overrides:
commitin classJDBCConnection- Throws:
java.sql.SQLException- if a database access error occurs, (JDBC4 Clarification:) this method is called while participating in a distributed transaction, if this method is called on a closed connection or thisConnectionobject is in auto-commit mode- See Also:
JDBCConnection.setAutoCommit(boolean)
-
rollback
public void rollback() throws java.sql.SQLExceptionInterceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.- Specified by:
rollbackin interfacejava.sql.Connection- Overrides:
rollbackin classJDBCConnection- Throws:
java.sql.SQLException- if a database access error occurs, (JDBC4 Clarification:) this method is called while participating in a distributed transaction, this method is called on a closed connection or thisConnectionobject is in auto-commit mode- See Also:
JDBCConnection.setAutoCommit(boolean)
-
rollback
public void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLExceptionInterceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.- Specified by:
rollbackin interfacejava.sql.Connection- Overrides:
rollbackin classJDBCConnection- Parameters:
savepoint- theSavepointobject to roll back to- Throws:
java.sql.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, theSavepointobject is no longer valid, or thisConnectionobject is currently in auto-commit mode- See Also:
JDBCSavepoint,Savepoint,JDBCConnection.rollback()
-
setSavepoint
public java.sql.Savepoint setSavepoint() throws java.sql.SQLExceptionInterceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.- Specified by:
setSavepointin interfacejava.sql.Connection- Overrides:
setSavepointin classJDBCConnection- Returns:
- the new
Savepointobject - Throws:
java.sql.SQLException- if a database access error occurs, (JDBC4 Clarification:) 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:
JDBCSavepoint,Savepoint
-
setSavepoint
public java.sql.Savepoint setSavepoint(java.lang.String name) throws java.sql.SQLExceptionInterceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.- Specified by:
setSavepointin interfacejava.sql.Connection- Overrides:
setSavepointin classJDBCConnection- Parameters:
name- aStringcontaining the name of the savepoint- Returns:
- the new
Savepointobject - Throws:
java.sql.SQLException- if a database access error occurs, (JDBC4 Clarification:) 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:
JDBCSavepoint,Savepoint
-
setTransactionIsolation
public void setTransactionIsolation(int level) throws java.sql.SQLExceptionInterceptor 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 interfacejava.sql.Connection- Overrides:
setTransactionIsolationin classJDBCConnection- Parameters:
level- one of the followingConnectionconstants:Connection.TRANSACTION_READ_UNCOMMITTED,Connection.TRANSACTION_READ_COMMITTED,Connection.TRANSACTION_REPEATABLE_READ, orConnection.TRANSACTION_SERIALIZABLE. (Note thatConnection.TRANSACTION_NONEcannot be used because it specifies that transactions are not supported.)- Throws:
java.sql.SQLException- if a database access error occurs, this (JDBC4 Clarification:) method is called on a closed connection (:JDBC4 End Clarification) or the given parameter is not one of theConnectionconstants- See Also:
JDBCDatabaseMetaData.supportsTransactionIsolationLevel(int),JDBCConnection.getTransactionIsolation()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG