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.ConnectionInterface that defines common methods.- Since:
- 23
-
-
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 thisConnectionobject.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 thisConnectionobject.voidcontinueOnError(ErrorSet errorSet)Configures a set of recoverable errors for asynchronous database operations executed by this connection.ErrorSetgetContinueOnErrorSet()Returns the set of recoverable errors for asynchronous database operations executed by this connection.booleanjoinOracle(java.time.Duration timeout)Returnstruewhen all Publishers created by this connection or its dependents have completed, or returnsfalsewhen the giventimeoutexpires before all Publishers have completed.voidresume()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
-
-
-
-
Method Detail
-
commitAsyncOracle
default java.util.concurrent.Flow.Publisher<java.lang.Void> commitAsyncOracle() throws java.sql.SQLExceptionAsynchronously make all changes made since the previous commit/rollback permanent and releases any database locks currently held by thisConnectionobject. This method should be used only when auto-commit mode has been disabled.After this method is called, calling any method of this
Connectionthat synchronously executes a database call will block until the returnedPublisheremitsonCompleteoronError, or has itsSubcriptioncancelled.The returned publisher will only emit
onCompleteoronError; No items are emitted toonNext.An invocation of this method is equivalent to invoking
commitAsyncOracle(ErrorSet)with theErrorSetconfigured bycontinueOnError(ErrorSet).- Returns:
- a
Publisherthat emitsonCompletewhen 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
Connectionobject. This method should be used only when auto-commit mode has been disabled.After this method is called, calling any method of this
Connectionthat synchronously executes a database call will block until the returnedPublisheremitsonCompleteoronError, or has itsSubcriptioncancelled.The returned publisher will only emit
onCompleteoronError; No items are emitted toonNext.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 nextresume().- Parameters:
continueOnErrorSet- Set of errors which do not cause subsequent operations to be aborted. Not null.- Returns:
- a
Publisherthat emitsonCompletewhen 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 modejava.lang.NullPointerException- if thecontinueOnErrorSetis nulljava.lang.IllegalArgumentException- if thecontinueOnErrorSetis not supported. At a minimum, all drivers must supportErrorSet.NO_ERRORSandErrorSet.ALL_ERRORS- Since:
- 23
-
rollbackAsyncOracle
default java.util.concurrent.Flow.Publisher<java.lang.Void> rollbackAsyncOracle() throws java.sql.SQLExceptionUndoes 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
Connectionthat synchronously executes a database call will block until the returnedPublisheremitsonCompleteoronError, or has itsSubcriptioncancelled.The returned publisher will only emit
onCompleteoronError; No items are emitted toonNext.An invocation of this method is equivalent to invoking
rollbackAsyncOracle(ErrorSet)with theErrorSetconfigured bycontinueOnError(ErrorSet).- Returns:
- a
Publisherthat emitsonCompletewhen 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
onCompleteoronError; No items are emitted toonNext.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
Publisherthat emitsonCompletewhen 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 modejava.lang.NullPointerException- if thecontinueOnErrorSetis nulljava.lang.IllegalArgumentException- if thecontinueOnErrorSetis not supported. At a minimum, all drivers must supportErrorSet.NO_ERRORSandErrorSet.ALL_ERRORS- Since:
- 23
-
closeAsyncOracle
java.util.concurrent.Flow.Publisher<java.lang.Void> closeAsyncOracle() throws java.sql.SQLExceptionReleases 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
Connectionthat synchronously executes a database call will block until the returnedPublisheremitsonCompleteoronError, or has itsSubcriptioncancelled.The returned publisher will only emit
onCompleteoronError; No items are emitted toonNext.- Returns:
- a
Publisherthat emitsonCompletewhen theConnectionis closed. - Throws:
java.sql.SQLException- if a database access error occurs- Since:
- 20
-
joinOracle
boolean joinOracle(java.time.Duration timeout) throws java.lang.InterruptedExceptionReturns
truewhen all Publishers created by this connection or its dependents have completed, or returnsfalsewhen the giventimeoutexpires 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
onCompleteoronErrorand 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 toonNext,onCompleteoronErrorto an existingSubscriberafter this method returnstrue.After this method returns
true, Publishers created before this method returned will emitonErrorwith anIllegalStateExceptionto any otherSubscriberthat subscribes.- Parameters:
timeout- the maximum time to wait- Returns:
trueif all Publishers have completed before thetimeout, otherwisefalse.- Throws:
java.lang.InterruptedException- if the current thread was interrupted while waiting- Since:
- 23
-
resume
void resume() throws java.sql.SQLExceptionResumes 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 nextresume().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 Connectionjava.lang.NullPointerException- if theerrorSetis nulljava.lang.IllegalArgumentException- if theerrorSetis not supported. At a minimum, all drivers must supportErrorSet.NO_ERRORSandErrorSet.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
-
-