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 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