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.ConnectionRxBatch instance@NonNull RxStatement createStatement(@NonNull java.lang.String sql)
createStatement in interface io.r2dbc.spi.Connectionsql - 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.ConnectionFlowable that indicates that the transaction is open@NonNull io.reactivex.Flowable<java.lang.Void> close()
Connection.close in interface io.r2dbc.spi.Closeableclose in interface io.r2dbc.spi.ConnectionFlowable that termination is complete@NonNull io.reactivex.Flowable<java.lang.Void> commitTransaction()
commitTransaction in interface io.r2dbc.spi.ConnectionFlowable 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.Connectionname - the name of the savepoint to createFlowable that indicates that a savepoint has been createdjava.lang.IllegalArgumentException - if name is nulljava.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.Connectionname - 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.ConnectionFlowable 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.Connectionname - the name of the savepoint to rollback toFlowable that indicates that a savepoint has been rolled back tojava.lang.IllegalArgumentException - if name is nulljava.lang.UnsupportedOperationException - if savepoints are not supported@NonNull io.reactivex.Flowable<java.lang.Void> setAutoCommit(boolean autoCommit)
Statements 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.ConnectionautoCommit - 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_UNCOMMITTEDIsolationLevel.READ_COMMITTEDIsolationLevel.REPEATABLE_READIsolationLevel.SERIALIZABLE
IsolationLevel is extensible so drivers can accept a vendor-specific IsolationLevel.
setTransactionIsolationLevel in interface io.r2dbc.spi.ConnectionisolationLevel - 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.Connectiondepth - the validation depthFlowable that indicates whether the validation was successfuljava.lang.IllegalArgumentException - if depth is null