Package oracle.jdbc

Interface OracleCommonConnection

All Superinterfaces:
AutoCloseable, Connection, Wrapper
All Known Subinterfaces:
OracleConnection
All Known Implementing Classes:
OracleConnectionWrapper

public interface OracleCommonConnection extends Connection
Interface that defines common methods.
Since:
23
  • Method Details

    • commitAsyncOracle

      default Flow.Publisher<Void> commitAsyncOracle() throws 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:
      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

      Flow.Publisher<Void> commitAsyncOracle(ErrorSet continueOnErrorSet) throws 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:
      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
      NullPointerException - if the continueOnErrorSet is null
      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 Flow.Publisher<Void> rollbackAsyncOracle() throws 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:
      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

      Flow.Publisher<Void> rollbackAsyncOracle(ErrorSet continueOnErrorSet) throws 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:
      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
      NullPointerException - if the continueOnErrorSet is null
      IllegalArgumentException - if the continueOnErrorSet is not supported. At a minimum, all drivers must support ErrorSet.NO_ERRORS and ErrorSet.ALL_ERRORS
      Since:
      23
    • closeAsyncOracle

      Flow.Publisher<Void> closeAsyncOracle() throws 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:
      SQLException - if a database access error occurs
      Since:
      20
    • joinOracle

      boolean joinOracle(Duration timeout) throws 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:
      InterruptedException - if the current thread was interrupted while waiting
      Since:
      23
    • resume

      void resume() throws 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:
      SQLException - If this connection is closed.
      Since:
      23
    • continueOnError

      void continueOnError(ErrorSet errorSet) throws 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:
      SQLException - if a database access error occurs or this method is called on a closed Connection
      NullPointerException - if the errorSet is null
      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 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:
      SQLException - if a database access error occurs or this method is called on a closed Connection
      Since:
      23