public interface RxConnection
extends io.r2dbc.spi.Connection
Connection
for RxJava.Modifier and Type | Method and Description |
---|---|
io.reactivex.Flowable<java.lang.Void> |
beginTransaction()
Begins a new transaction.
|
io.reactivex.Flowable<java.lang.Void> |
close()
Release any resources held by the
Connection . |
io.reactivex.Flowable<java.lang.Void> |
commitTransaction()
Commits the current transaction.
|
RxBatch |
createBatch()
Creates a new
RxBatch instance for building a batched request. |
io.reactivex.Flowable<java.lang.Void> |
createSavepoint(java.lang.String name)
Creates a savepoint in the current transaction.
|
RxStatement |
createStatement(java.lang.String sql)
Creates a new statement for building a statement-based request.
|
io.reactivex.Flowable<java.lang.Void> |
releaseSavepoint(java.lang.String name)
Releases a savepoint in the current transaction.
|
io.reactivex.Flowable<java.lang.Void> |
rollbackTransaction()
Rolls back the current transaction.
|
io.reactivex.Flowable<java.lang.Void> |
rollbackTransactionToSavepoint(java.lang.String name)
Rolls back to a savepoint in the current transaction.
|
io.reactivex.Flowable<java.lang.Void> |
setAutoCommit(boolean autoCommit)
Configures the auto-commit mode for the current transaction.
|
io.reactivex.Flowable<java.lang.Void> |
setTransactionIsolationLevel(io.r2dbc.spi.IsolationLevel isolationLevel)
Configures the isolation level for the current transaction.
|
io.reactivex.Flowable<java.lang.Boolean> |
validate(io.r2dbc.spi.ValidationDepth depth)
Validates the connection according to the given
ValidationDepth . |
@NonNull RxBatch createBatch()
RxBatch
instance for building a batched request.createBatch
in interface io.r2dbc.spi.Connection
RxBatch
instance@NonNull RxStatement createStatement(@NonNull java.lang.String sql)
createStatement
in interface io.r2dbc.spi.Connection
sql
- the SQL of the statementRxStatement
instancejava.lang.IllegalArgumentException
- if sql
is null
@NonNull io.reactivex.Flowable<java.lang.Void> beginTransaction()
auto-commit
mode.beginTransaction
in interface io.r2dbc.spi.Connection
Flowable
that indicates that the transaction is open@NonNull io.reactivex.Flowable<java.lang.Void> close()
Connection
.close
in interface io.r2dbc.spi.Closeable
close
in interface io.r2dbc.spi.Connection
Flowable
that termination is complete@NonNull io.reactivex.Flowable<java.lang.Void> commitTransaction()
commitTransaction
in interface io.r2dbc.spi.Connection
Flowable
that indicates that a transaction has been committed@NonNull io.reactivex.Flowable<java.lang.Void> createSavepoint(java.lang.String name)
createSavepoint
in interface io.r2dbc.spi.Connection
name
- the name of the savepoint to createFlowable
that indicates that a savepoint has been createdjava.lang.IllegalArgumentException
- if name
is null
java.lang.UnsupportedOperationException
- if savepoints are not supported@NonNull io.reactivex.Flowable<java.lang.Void> releaseSavepoint(@NonNull java.lang.String name)
releaseSavepoint
in interface io.r2dbc.spi.Connection
name
- the name of the savepoint to releaseFlowable
that indicates that a savepoint has been releasedjava.lang.IllegalArgumentException
- if name
is null
@NonNull io.reactivex.Flowable<java.lang.Void> rollbackTransaction()
rollbackTransaction
in interface io.r2dbc.spi.Connection
Flowable
that indicates that a transaction has been rolled back@NonNull io.reactivex.Flowable<java.lang.Void> rollbackTransactionToSavepoint(@NonNull java.lang.String name)
rollbackTransactionToSavepoint
in interface io.r2dbc.spi.Connection
name
- the name of the savepoint to rollback toFlowable
that indicates that a savepoint has been rolled back tojava.lang.IllegalArgumentException
- if name
is null
java.lang.UnsupportedOperationException
- if savepoints are not supported@NonNull io.reactivex.Flowable<java.lang.Void> setAutoCommit(boolean autoCommit)
Statement
s will be executed and committed as individual transactions.
Otherwise, in explicit transaction mode, transactions have to be started
explicitly.
A transaction needs to be either committed
or rolled back
to clean up the transaction state.
Calling this method during an active transaction and the auto-commit mode is changed, the transaction is committed. Calling this method without changing auto-commit mode this invocation results in a no-op.
setAutoCommit
in interface io.r2dbc.spi.Connection
autoCommit
- the isolation level for this transactionFlowable
that indicates that auto-commit mode has been configured@NonNull io.reactivex.Flowable<java.lang.Void> setTransactionIsolationLevel(@NonNull io.r2dbc.spi.IsolationLevel isolationLevel)
Isolation level is typically one of the following constants:
IsolationLevel.READ_UNCOMMITTED
IsolationLevel.READ_COMMITTED
IsolationLevel.REPEATABLE_READ
IsolationLevel.SERIALIZABLE
IsolationLevel
is extensible so drivers can accept a vendor-specific IsolationLevel
.
setTransactionIsolationLevel
in interface io.r2dbc.spi.Connection
isolationLevel
- the isolation level for this transactionFlowable
that indicates that a transaction level has been configuredjava.lang.IllegalArgumentException
- if isolationLevel
is null
@NonNull io.reactivex.Flowable<java.lang.Boolean> validate(@NonNull io.r2dbc.spi.ValidationDepth depth)
ValidationDepth
.
Emits true if the validation was successful or false if the validation failed. Does not emit errors and does not complete empty.validate
in interface io.r2dbc.spi.Connection
depth
- the validation depthFlowable
that indicates whether the validation was successfuljava.lang.IllegalArgumentException
- if depth
is null