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 TypeMethodDescriptionboolean
Returns 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.boolean
readOnly()
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.long
Returns 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'.- For RO transactions, the default timeout is configured via ignite.transaction.timeout configuration property.
- For RW transactions, timeouts are not supported yet.
- 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
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.
-
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:
this
for chaining.- See Also:
-