public interface ClientTransactions
Transactions are bound to the thread started the transaction. After that, each cache operation within this thread will belong to the corresponding transaction until the transaction is committed, rolled back or closed.
Transactions are AutoCloseable
, so they will automatically rollback unless explicitly committed.
Default values for transaction isolation level, concurrency and timeout can be configured via
ClientConfiguration.setTransactionConfiguration(ClientTransactionConfiguration)
property.
ClientTransactionConfiguration
Modifier and Type | Method and Description |
---|---|
ClientTransaction |
txStart()
Starts a new transaction with the default isolation level, concurrency and timeout.
|
ClientTransaction |
txStart(TransactionConcurrency concurrency,
TransactionIsolation isolation)
Starts a new transaction with the specified concurrency and isolation.
|
ClientTransaction |
txStart(TransactionConcurrency concurrency,
TransactionIsolation isolation,
long timeout)
Starts a new transaction with the specified isolation, concurrency and timeout.
|
ClientTransactions |
withLabel(String lb)
Returns instance of
ClientTransactions to mark each new transaction with a specified label. |
ClientTransaction txStart() throws org.apache.ignite.internal.client.thin.ClientServerError, ClientException
ClientException
- If some unfinished transaction has already started by this thread.org.apache.ignite.internal.client.thin.ClientServerError
ClientTransaction txStart(TransactionConcurrency concurrency, TransactionIsolation isolation) throws org.apache.ignite.internal.client.thin.ClientServerError, ClientException
concurrency
- Concurrency.isolation
- Isolation.ClientException
- If some unfinished transaction has already started by this thread.org.apache.ignite.internal.client.thin.ClientServerError
ClientTransaction txStart(TransactionConcurrency concurrency, TransactionIsolation isolation, long timeout) throws org.apache.ignite.internal.client.thin.ClientServerError, ClientException
concurrency
- Concurrency.isolation
- Isolation.timeout
- Timeout.ClientException
- If some unfinished transaction has already started by this thread.org.apache.ignite.internal.client.thin.ClientServerError
ClientTransactions withLabel(String lb) throws ClientException
ClientTransactions
to mark each new transaction with a specified label.lb
- Label.This
for chaining.NullPointerException
- If label is null.ClientException
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024