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
-
-
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 thisConnection
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 thisConnection
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)
Returnstrue
when all Publishers created by this connection or its dependents have completed, or returnsfalse
when the giventimeout
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
-
-
-
-
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 thisConnection
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 returnedPublisher
emitsonComplete
oronError
, or has itsSubcription
cancelled.The returned publisher will only emit
onComplete
oronError
; No items are emitted toonNext
.An invocation of this method is equivalent to invoking
commitAsyncOracle(ErrorSet)
with theErrorSet
configured bycontinueOnError(ErrorSet)
.- Returns:
- a
Publisher
that emitsonComplete
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 returnedPublisher
emitsonComplete
oronError
, or has itsSubcription
cancelled.The returned publisher will only emit
onComplete
oronError
; 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
Publisher
that emitsonComplete
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 modejava.lang.NullPointerException
- if thecontinueOnErrorSet
is nulljava.lang.IllegalArgumentException
- if thecontinueOnErrorSet
is not supported. At a minimum, all drivers must supportErrorSet.NO_ERRORS
andErrorSet.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 returnedPublisher
emitsonComplete
oronError
, or has itsSubcription
cancelled.The returned publisher will only emit
onComplete
oronError
; No items are emitted toonNext
.An invocation of this method is equivalent to invoking
rollbackAsyncOracle(ErrorSet)
with theErrorSet
configured bycontinueOnError(ErrorSet)
.- Returns:
- a
Publisher
that emitsonComplete
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
oronError
; 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
Publisher
that emitsonComplete
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 modejava.lang.NullPointerException
- if thecontinueOnErrorSet
is nulljava.lang.IllegalArgumentException
- if thecontinueOnErrorSet
is not supported. At a minimum, all drivers must supportErrorSet.NO_ERRORS
andErrorSet.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 returnedPublisher
emitsonComplete
oronError
, or has itsSubcription
cancelled.The returned publisher will only emit
onComplete
oronError
; No items are emitted toonNext
.- Returns:
- a
Publisher
that emitsonComplete
when theConnection
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 returnsfalse
when the giventimeout
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
oronError
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 toonNext
,onComplete
oronError
to an existingSubscriber
after this method returnstrue
.After this method returns
true
, Publishers created before this method returned will emitonError
with anIllegalStateException
to any otherSubscriber
that subscribes.- Parameters:
timeout
- the maximum time to wait- Returns:
true
if 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.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 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 theerrorSet
is nulljava.lang.IllegalArgumentException
- if theerrorSet
is not supported. At a minimum, all drivers must supportErrorSet.NO_ERRORS
andErrorSet.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
-
-