public final class MySqlTransactionDefinition extends Object implements io.r2dbc.spi.TransactionDefinition
TransactionDefinition for MySQL transactions.
Note: The lock wait timeout is only available in InnoDB, and only supports seconds, which must be between 1 and 1073741824.
| Modifier and Type | Class and Description |
|---|---|
static class |
MySqlTransactionDefinition.Builder
A builder considers to create
TransactionDefinition. |
| Modifier and Type | Field and Description |
|---|---|
static io.r2dbc.spi.Option<ConsistentSnapshotEngine> |
CONSISTENT_SNAPSHOT_ENGINE
Use
START TRANSACTION WITH CONSISTENT [engine] SNAPSHOT for Facebook/MySQL or similar syntax. |
static io.r2dbc.spi.Option<Long> |
CONSISTENT_SNAPSHOT_FROM_SESSION
Use
START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION [session_id] for Percona/MySQL or
similar syntax. |
static io.r2dbc.spi.Option<Boolean> |
WITH_CONSISTENT_SNAPSHOT
Use
WITH CONSISTENT SNAPSHOT syntax, all MySQL-compatible servers should support this syntax. |
| Modifier and Type | Method and Description |
|---|---|
static MySqlTransactionDefinition.Builder |
builder()
Creates a builder without any value.
|
static MySqlTransactionDefinition |
empty()
Defines an empty transaction.
|
<T> T |
getAttribute(io.r2dbc.spi.Option<T> option) |
MySqlTransactionDefinition.Builder |
mutate()
Returns a builder to mutate options of this definition by creating a new instance and returning either
mutated values or old values.
|
public static final io.r2dbc.spi.Option<Boolean> WITH_CONSISTENT_SNAPSHOT
WITH CONSISTENT SNAPSHOT syntax, all MySQL-compatible servers should support this syntax.
The option starts a consistent read for storage engines such as InnoDB and XtraDB that can do so, the
same as if a START TRANSACTION followed by a SELECT ... from any InnoDB table was
issued.
NOTICE: This option and TransactionDefinition.READ_ONLY cannot be enabled at the same definition.
public static final io.r2dbc.spi.Option<ConsistentSnapshotEngine> CONSISTENT_SNAPSHOT_ENGINE
START TRANSACTION WITH CONSISTENT [engine] SNAPSHOT for Facebook/MySQL or similar syntax.
Only available when WITH_CONSISTENT_SNAPSHOT is set to true.
NOTICE: This is an extended syntax for special servers. Before using it, check whether the server supports the syntax.
public static final io.r2dbc.spi.Option<Long> CONSISTENT_SNAPSHOT_FROM_SESSION
START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION [session_id] for Percona/MySQL or
similar syntax. Only available when WITH_CONSISTENT_SNAPSHOT is set to true.
The session_id is the session identifier reported in the Id column of the process list.
Reported by SHOW COLUMNS FROM performance_schema.processlist, it should be an unsigned 64-bit
integer. Use SHOW PROCESSLIST to find session identifier of the process list.
NOTICE: This is an extended syntax for special servers. Before using it, check whether the server supports the syntax.
public <T> T getAttribute(io.r2dbc.spi.Option<T> option)
getAttribute in interface io.r2dbc.spi.TransactionDefinitionpublic MySqlTransactionDefinition.Builder mutate()
public static MySqlTransactionDefinition empty()
public static MySqlTransactionDefinition.Builder builder()
Copyright © 2018–2023 asyncer.io. All rights reserved.