Package org.apache.ignite.tx
Class TransactionOptions
java.lang.Object
org.apache.ignite.tx.TransactionOptions
Ignite transaction options.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns a value indicating whether a cache-only transaction should be used.cacheOnly(boolean cacheOnly) Sets a value indicating whether a cache-only transaction should be used.@Nullable Stringlabel()Returns transaction label.Sets the transaction label.booleanreadOnly()Returns a value indicating whether a read-only transaction should be used.readOnly(boolean readOnly) Sets a value indicating whether a read-only transaction should be used.longReturns transaction timeout, in milliseconds.timeoutMillis(long timeoutMillis) Sets transaction timeout, in milliseconds.
-
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
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:
thisfor 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
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:
thisfor chaining.
-
label
Returns transaction label. The label is included in diagnostic and observability outputs, such as logs, system views, etc.- Returns:
- Transaction label, or
nullif not set.
-
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 benullto clear the label.- Returns:
thisfor 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
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:
thisfor chaining.- See Also:
-