Package org.apache.ignite.client

## Interface ClientTransactions

-     public interface ClientTransactions

  Thin client transactions facade.

  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.

  See Also:
    `ClientTransactionConfiguration`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | 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.

- - ### Method Detail

    - #### txStart

          ClientTransaction txStart()
                             throws org.apache.ignite.internal.client.thin.ClientServerError,
                                    ClientException

      Starts a new transaction with the default isolation level, concurrency and timeout.
      Returns:
        New transaction.
      Throws:
        `ClientException` - If some unfinished transaction has already started by this thread.
        `org.apache.ignite.internal.client.thin.ClientServerError`

    - #### txStart

          ClientTransaction txStart​(TransactionConcurrency concurrency,
                                    TransactionIsolation isolation)
                             throws org.apache.ignite.internal.client.thin.ClientServerError,
                                    ClientException

      Starts a new transaction with the specified concurrency and isolation.
      Parameters:
        `concurrency` - Concurrency.
        `isolation` - Isolation.
      Returns:
        New transaction.
      Throws:
        `ClientException` - If some unfinished transaction has already started by this thread.
        `org.apache.ignite.internal.client.thin.ClientServerError`

    - #### txStart

          ClientTransaction txStart​(TransactionConcurrency concurrency,
                                    TransactionIsolation isolation,
                                    long timeout)
                             throws org.apache.ignite.internal.client.thin.ClientServerError,
                                    ClientException

      Starts a new transaction with the specified isolation, concurrency and timeout.
      Parameters:
        `concurrency` - Concurrency.
        `isolation` - Isolation.
        `timeout` - Timeout.
      Returns:
        New transaction.
      Throws:
        `ClientException` - If some unfinished transaction has already started by this thread.
        `org.apache.ignite.internal.client.thin.ClientServerError`

    - #### withLabel

          ClientTransactions withLabel​(String lb)
                                throws ClientException

      Returns instance of `ClientTransactions` to mark each new transaction with a specified label.
      Parameters:
        `lb` - Label.
      Returns:
        `This` for chaining.
      Throws:
        `NullPointerException` - If label is null.
        `ClientException`