Module org.hsqldb

Class 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:
    HSQLDB 2.0.0
    Author:
    Blaine Simpson (blaine dot simpson at admc dot com)
    See Also:
    JDBCConnection
    • Constructor Detail

    • Method Detail

      • setAutoCommit

        public void setAutoCommit​(boolean autoCommit)
                           throws java.sql.SQLException
        Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.
        Specified by:
        setAutoCommit in interface java.sql.Connection
        Overrides:
        setAutoCommit in class JDBCConnection
        Parameters:
        autoCommit - mode
        Throws:
        java.sql.SQLException - on error
        See Also:
        JDBCConnection.getAutoCommit()
      • commit

        public void commit()
                    throws java.sql.SQLException
        Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.
        Specified by:
        commit in interface java.sql.Connection
        Overrides:
        commit in class JDBCConnection
        Throws:
        java.sql.SQLException - on error
        See Also:
        JDBCConnection.setAutoCommit(boolean)
      • rollback

        public void rollback()
                      throws java.sql.SQLException
        Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.
        Specified by:
        rollback in interface java.sql.Connection
        Overrides:
        rollback in class JDBCConnection
        Throws:
        java.sql.SQLException - on error
        See Also:
        JDBCConnection.setAutoCommit(boolean)
      • rollback

        public void rollback​(java.sql.Savepoint savepoint)
                      throws java.sql.SQLException
        Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.
        Specified by:
        rollback in interface java.sql.Connection
        Overrides:
        rollback in class JDBCConnection
        Parameters:
        savepoint - the Savepoint object to roll back to
        Throws:
        java.sql.SQLException - on error
        See Also:
        JDBCSavepoint, Savepoint, JDBCConnection.rollback()
      • setSavepoint

        public java.sql.Savepoint setSavepoint()
                                        throws java.sql.SQLException
        Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.
        Specified by:
        setSavepoint in interface java.sql.Connection
        Overrides:
        setSavepoint in class JDBCConnection
        Returns:
        the new Savepoint object
        Throws:
        java.sql.SQLException - on error
        See Also:
        JDBCSavepoint, Savepoint
      • setSavepoint

        public java.sql.Savepoint setSavepoint​(java.lang.String name)
                                        throws java.sql.SQLException
        Interceptor method, because this method is prohibited within any global transaction. See section 1.2.4 of the JDBC 3.0 spec.
        Specified by:
        setSavepoint in interface java.sql.Connection
        Overrides:
        setSavepoint in class JDBCConnection
        Parameters:
        name - a String containing the name of the savepoint
        Returns:
        the new Savepoint object
        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 or this Connection object is currently in auto-commit mode
        java.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this method
        See Also:
        JDBCSavepoint, Savepoint
      • setTransactionIsolation

        public void setTransactionIsolation​(int level)
                                     throws java.sql.SQLException
        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:
        setTransactionIsolation in interface java.sql.Connection
        Overrides:
        setTransactionIsolation in class JDBCConnection
        Parameters:
        level - isolation level
        Throws:
        java.sql.SQLException - 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
        See Also:
        JDBCDatabaseMetaData.supportsTransactionIsolationLevel(int), JDBCConnection.getTransactionIsolation()