Top Description Fields Methods
io.r2dbc.spi

public Interface TransactionDefinition

Known Direct Implementers
io.r2dbc.spi.IsolationLevel
Imports
java.time.Duration

Specification of properties to be used when starting a transaction. This interface is typically implemented by code that calls Connection#beginTransaction(TransactionDefinition).
Since
0.9
See Also
Connection#beginTransaction(TransactionDefinition), Option

Field Summary

Modifier and TypeField and Description
public static final Option<IsolationLevel>
ISOLATION_LEVEL

Isolation level requested for the transaction.

public static final Option<Duration>
LOCK_WAIT_TIMEOUT

Lock wait timeout.

public static final Option<String>
NAME

Name of the transaction.

public static final Option<Boolean>
READ_ONLY

The transaction mutability (i.e. whether the transaction should be started in read-only mode).

Method Summary

Modifier and TypeMethod and Description
public <
requested value type
T
>
T

Returns:

the value of the transaction attribute. Can be null to indicate absence of the attribute.
getAttribute
(Option<T>
the option to retrieve the value for
option
)

Retrieve a transaction attribute by its Option identifier.

Field Detail

ISOLATION_LEVELback to summary
public static final Option<IsolationLevel> ISOLATION_LEVEL

Isolation level requested for the transaction.

LOCK_WAIT_TIMEOUTback to summary
public static final Option<Duration> LOCK_WAIT_TIMEOUT

Lock wait timeout.

NAMEback to summary
public static final Option<String> NAME

Name of the transaction.

READ_ONLYback to summary
public static final Option<Boolean> READ_ONLY

The transaction mutability (i.e. whether the transaction should be started in read-only mode).

Method Detail

getAttributeback to summary
public <T> T getAttribute(Option<T> option)

Retrieve a transaction attribute by its Option identifier. This low-level interface allows querying transaction attributes supported by the Connection that should be applied when starting a new transaction.

Parameters
<T>
requested value type
option:Option<T>

the option to retrieve the value for

Returns:T

the value of the transaction attribute. Can be null to indicate absence of the attribute.

Annotations
@Nullable
Exceptions
IllegalArgumentException:
if name or type is null