Class TransactionOptions

java.lang.Object
org.apache.ignite.tx.TransactionOptions

public class TransactionOptions extends Object
Ignite transaction options.
  • Constructor Details

    • TransactionOptions

      public TransactionOptions()
  • Method Details

    • timeoutMillis

      public long timeoutMillis()
      Returns transaction timeout, in milliseconds. 0 means 'use default timeout'.
      Returns:
      Transaction timeout, in milliseconds.
    • timeoutMillis

      public TransactionOptions timeoutMillis(long timeoutMillis)
      Sets transaction timeout, in milliseconds.
      Parameters:
      timeoutMillis - Transaction timeout, in milliseconds. Cannot be negative; 0 means 'use default timeout'. the default timeout is configured via ignite.transaction.timeout configuration property.
      Returns:
      this for chaining.
    • readOnly

      public boolean readOnly()
      Returns a value indicating whether a read-only transaction should be used.

      Read-only transactions provide a snapshot view of data at a certain point in time. They are lock-free and perform better than normal transactions, but do not permit data modifications.

      Returns:
      Whether a read-only transaction should be used.
    • readOnly

      public TransactionOptions readOnly(boolean readOnly)
      Sets a value indicating whether a read-only transaction should be used.

      Read-only transactions provide a snapshot view of data at a certain point in time. They are lock-free and perform better than normal transactions, but do not permit data modifications.

      Parameters:
      readOnly - Whether a read-only transaction should be used.
      Returns:
      this for chaining.
    • label

      @Nullable public @Nullable String label()
      Returns transaction label. The label is included in diagnostic and observability outputs, such as logs, system views, etc.
      Returns:
      Transaction label, or null if not set.
    • label

      public TransactionOptions label(@Nullable @Nullable String label)
      Sets the transaction label. The label is included in diagnostic and observability outputs, such as logs, system views, etc.

      Use labels to help identify and track transactions for debugging and monitoring. Once set, the label remains unchanged for the lifetime of the transaction.

      Parameters:
      label - Transaction label. Can be null to clear the label.
      Returns:
      this for chaining.
    • cacheOnly

      public boolean cacheOnly()
      Returns a value indicating whether a cache-only transaction should be used.
      Returns:
      Whether a cache-only transaction should be used.
    • cacheOnly

      public TransactionOptions cacheOnly(boolean cacheOnly)
      Sets a value indicating whether a cache-only transaction should be used.

      This type of transactions is only compatible with caches and do not support read-only mode (this flag is ignored).

      Parameters:
      cacheOnly - Whether a cache-only transaction should be used.
      Returns:
      this for chaining.
      See Also: