Package oracle.jdbc

Interface OracleCommonConnection

  • All Superinterfaces:
    java.lang.AutoCloseable, java.sql.Connection, java.sql.Wrapper
    All Known Subinterfaces:
    OracleConnection
    All Known Implementing Classes:
    OracleConnectionWrapper

    public interface OracleCommonConnection
    extends java.sql.Connection
    Interface that defines common methods.
    Since:
    23
    • Field Summary

      • Fields inherited from interface java.sql.Connection

        TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      java.util.concurrent.Flow.Publisher<java.lang.Void> closeAsyncOracle()
      Releases this Connection object's database and JDBC resources immediately.
      default java.util.concurrent.Flow.Publisher<java.lang.Void> commitAsyncOracle()
      Asynchronously make all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object.
      java.util.concurrent.Flow.Publisher<java.lang.Void> commitAsyncOracle​(ErrorSet continueOnErrorSet)
      Asynchronously make all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object.
      void continueOnError​(ErrorSet errorSet)
      Configures a set of recoverable errors for asynchronous database operations executed by this connection.
      ErrorSet getContinueOnErrorSet()
      Returns the set of recoverable errors for asynchronous database operations executed by this connection.
      boolean joinOracle​(java.time.Duration timeout)
      Returns true when all Publishers created by this connection or its dependents have completed, or returns false when the given timeout expires before all Publishers have completed.
      void resume()
      Resumes execution if a previous asynchronous operation caused the connection to abort on error, otherwise calling this method does nothing.
      default java.util.concurrent.Flow.Publisher<java.lang.Void> rollbackAsyncOracle()
      Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object.
      java.util.concurrent.Flow.Publisher<java.lang.Void> rollbackAsyncOracle​(ErrorSet continueOnErrorSet)
      Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object.
      • Methods inherited from interface java.sql.Connection

        abort, beginRequest, clearWarnings, close, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, endRequest, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getNetworkTimeout, getSchema, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, isValid, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setNetworkTimeout, setReadOnly, setSavepoint, setSavepoint, setSchema, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid, setTransactionIsolation, setTypeMap
      • Methods inherited from interface java.sql.Wrapper

        isWrapperFor, unwrap
    • Method Detail

      • commitAsyncOracle

        default java.util.concurrent.Flow.Publisher<java.lang.Void> commitAsyncOracle()
                                                                               throws java.sql.SQLException
        Asynchronously make all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled.

        After this method is called, calling any method of this Connection that synchronously executes a database call will block until the returned Publisher emits onComplete or onError, or has its Subcription cancelled.

        The returned publisher will only emit onComplete or onError; No items are emitted to onNext.

        An invocation of this method is equivalent to invoking commitAsyncOracle(ErrorSet) with the ErrorSet configured by continueOnError(ErrorSet).

        Returns:
        a Publisher that emits onComplete when the database commit is completed.
        Throws:
        java.sql.SQLException - if a database access error occurs, this method is called while participating in a distributed transaction, if this method is called on a closed connection or this Connection object is in auto-commit mode
        Since:
        20
      • commitAsyncOracle

        java.util.concurrent.Flow.Publisher<java.lang.Void> commitAsyncOracle​(ErrorSet continueOnErrorSet)
                                                                       throws java.sql.SQLException

        Asynchronously make all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled.

        After this method is called, calling any method of this Connection that synchronously executes a database call will block until the returned Publisher emits onComplete or onError, or has its Subcription cancelled.

        The returned publisher will only emit onComplete or onError; No items are emitted to onNext.

        When this method returns, the commit operation will have entered into the execution pipeline of this connection. If the commit fails with an error not in continueOnErrorSet, the pipeline will abort all subsequent asynchronous operations, up to the next resume().

        Parameters:
        continueOnErrorSet - Set of errors which do not cause subsequent operations to be aborted. Not null.
        Returns:
        a Publisher that emits onComplete when the database commit is completed. Not null.
        Throws:
        java.sql.SQLException - if a database access error occurs, this method is called while participating in a distributed transaction, if this method is called on a closed connection, or if this Connection object is in auto-commit mode
        java.lang.NullPointerException - if the continueOnErrorSet is null
        java.lang.IllegalArgumentException - if the continueOnErrorSet is not supported. At a minimum, all drivers must support ErrorSet.NO_ERRORS and ErrorSet.ALL_ERRORS
        Since:
        23
      • rollbackAsyncOracle

        default java.util.concurrent.Flow.Publisher<java.lang.Void> rollbackAsyncOracle()
                                                                                 throws java.sql.SQLException
        Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled.

        After this method is called, calling any method of this Connection that synchronously executes a database call will block until the returned Publisher emits onComplete or onError, or has its Subcription cancelled.

        The returned publisher will only emit onComplete or onError; No items are emitted to onNext.

        An invocation of this method is equivalent to invoking rollbackAsyncOracle(ErrorSet) with the ErrorSet configured by continueOnError(ErrorSet).

        Returns:
        a Publisher that emits onComplete when the database rollback is completed.
        Throws:
        java.sql.SQLException - if a database access error occurs, this method is called while participating in a distributed transaction, if this method is called on a closed connection or this Connection object is in auto-commit mode
        Since:
        20
      • rollbackAsyncOracle

        java.util.concurrent.Flow.Publisher<java.lang.Void> rollbackAsyncOracle​(ErrorSet continueOnErrorSet)
                                                                         throws java.sql.SQLException
        Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled.

        The returned publisher will only emit onComplete or onError; No items are emitted to onNext.

        When this method returns, the rollback operation will have entered into the execution pipeline of this connection. If the rollback fails with an error not in continueOnErrorSet, the pipeline will abort all subsequent asynchronous operations, up to the next resume or close.

        Parameters:
        continueOnErrorSet - Set of errors which do not cause subsequent operations to be aborted. Not null.
        Returns:
        a Publisher that emits onComplete when the database rollback is completed. Not null.
        Throws:
        java.sql.SQLException - if a database access error occurs, this method is called while participating in a distributed transaction, if this method is called on a closed connection, or if this Connection object is in auto-commit mode
        java.lang.NullPointerException - if the continueOnErrorSet is null
        java.lang.IllegalArgumentException - if the continueOnErrorSet is not supported. At a minimum, all drivers must support ErrorSet.NO_ERRORS and ErrorSet.ALL_ERRORS
        Since:
        23
      • closeAsyncOracle

        java.util.concurrent.Flow.Publisher<java.lang.Void> closeAsyncOracle()
                                                                      throws java.sql.SQLException
        Releases this Connection object's database and JDBC resources immediately. Calling the method close on a Connection object that is already closed is a no-op.

        After this method is called, calling any method of this Connection that synchronously executes a database call will block until the returned Publisher emits onComplete or onError, or has its Subcription cancelled.

        The returned publisher will only emit onComplete or onError; No items are emitted to onNext.

        Returns:
        a Publisher that emits onComplete when the Connection is closed.
        Throws:
        java.sql.SQLException - if a database access error occurs
        Since:
        20
      • joinOracle

        boolean joinOracle​(java.time.Duration timeout)
                    throws java.lang.InterruptedException

        Returns true when all Publishers created by this connection or its dependents have completed, or returns false when the given timeout expires before all Publishers have completed.

        Publishers created after this method is called but before it returns behave exactly the same as Publishers created before this method is called.

        A Publisher is complete after it has called onComplete or onError and that call has returned or it has no Subscribers to which the Publisher will make more calls. No Publisher that was created before this method returns will make another call to onNext, onComplete or onError to an existing Subscriber after this method returns true.

        After this method returns true, Publishers created before this method returned will emit onError with an IllegalStateException to any other Subscriber that subscribes.

        Parameters:
        timeout - the maximum time to wait
        Returns:
        true if all Publishers have completed before the timeout, otherwise false.
        Throws:
        java.lang.InterruptedException - if the current thread was interrupted while waiting
        Since:
        23
      • resume

        void resume()
             throws java.sql.SQLException

        Resumes execution if a previous asynchronous operation caused the connection to abort on error, otherwise calling this method does nothing. Conceptually, this method submits an asynchronous operation to the server that is executed in sequence with all other asynchronous operations such as SQL execution, commit, and rollback.

        Execution is resumed implicitly upon invoking any method that synchronously executes a database call.

        Throws:
        java.sql.SQLException - If this connection is closed.
        Since:
        23
      • continueOnError

        void continueOnError​(ErrorSet errorSet)
                      throws java.sql.SQLException

        Configures a set of recoverable errors for asynchronous database operations executed by this connection. Asynchronous database operations include statement executions, result set fetches, LOB reads, LOB writes, commits, and rollbacks. If any of these operations fail with an error that is not contained in the given errorSet, then the execution all subsequent operations are aborted until the next resume().

        The default setting is to continue on ErrorSet.ALL_ERRORS, such that no failure will cause subsequent operations to be aborted.

        Parameters:
        errorSet - the set of errors which do not abort subsequent operations. Not null.
        Throws:
        java.sql.SQLException - if a database access error occurs or this method is called on a closed Connection
        java.lang.NullPointerException - if the errorSet is null
        java.lang.IllegalArgumentException - if the errorSet is not supported. At a minimum, all drivers must support ErrorSet.NO_ERRORS and ErrorSet.ALL_ERRORS
        Since:
        23
      • getContinueOnErrorSet

        ErrorSet getContinueOnErrorSet()
                                throws java.sql.SQLException

        Returns the set of recoverable errors for asynchronous database operations executed by this connection. The value returned by this method is configured by continueOnError(ErrorSet).

        Returns:
        the set of errors which do not abort subsequent operations. Not null.
        Throws:
        java.sql.SQLException - if a database access error occurs or this method is called on a closed Connection
        Since:
        23