public class TransactionConfiguration extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static long |
DFLT_DEADLOCK_TIMEOUT
Default timeout before starting deadlock detection.
|
static int |
DFLT_PESSIMISTIC_TX_LOG_LINGER
Default size of pessimistic transactions log.
|
static long |
DFLT_TRANSACTION_TIMEOUT
Default transaction timeout.
|
static TransactionConcurrency |
DFLT_TX_CONCURRENCY
Default concurrency mode.
|
static TransactionIsolation |
DFLT_TX_ISOLATION
Default transaction isolation level.
|
static boolean |
DFLT_TX_SERIALIZABLE_ENABLED
Default value for 'txSerializableEnabled' flag.
|
static long |
TX_TIMEOUT_ON_PARTITION_MAP_EXCHANGE
Transaction timeout on partition map synchronization.
|
Constructor and Description |
---|
TransactionConfiguration()
Empty constructor.
|
TransactionConfiguration(TransactionConfiguration cfg) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
TX configuration is used in node attributes, thus we must be able to compare it.
|
long |
getDeadlockTimeout()
This is an experimental feature.
|
TransactionConcurrency |
getDefaultTxConcurrency()
Default cache transaction concurrency to use when one is not explicitly
specified.
|
TransactionIsolation |
getDefaultTxIsolation()
Default cache transaction isolation to use when one is not explicitly
specified.
|
long |
getDefaultTxTimeout()
Gets default transaction timeout.
|
int |
getPessimisticTxLogLinger()
Gets delay, in milliseconds, after which pessimistic recovery entries will be cleaned up for failed node.
|
int |
getPessimisticTxLogSize()
Gets size of pessimistic transactions log stored on node in order to recover transaction commit if originating
node has left grid before it has sent all messages to transaction nodes.
|
<T> javax.cache.configuration.Factory<T> |
getTxManagerFactory()
Gets transaction manager factory for integration with JEE app servers.
|
String |
getTxManagerLookupClassName()
Deprecated.
Use
getTxManagerFactory() instead. |
long |
getTxTimeoutOnPartitionMapExchange()
Some Ignite operations provoke partition map exchange process within Ignite to ensure the partitions distribution
state is synchronized cluster-wide.
|
int |
hashCode() |
boolean |
isTxSerializableEnabled()
Deprecated.
|
boolean |
isUseJtaSynchronization() |
TransactionConfiguration |
setDeadlockTimeout(long deadlockTimeout)
This is an experimental feature.
|
TransactionConfiguration |
setDefaultTxConcurrency(TransactionConcurrency dfltConcurrency)
Sets default transaction concurrency.
|
TransactionConfiguration |
setDefaultTxIsolation(TransactionIsolation dfltIsolation)
Sets default transaction isolation.
|
TransactionConfiguration |
setDefaultTxTimeout(long dfltTxTimeout)
Sets default transaction timeout in milliseconds.
|
TransactionConfiguration |
setPessimisticTxLogLinger(int pessimisticTxLogLinger)
Sets cleanup delay for pessimistic transaction recovery log for failed node, in milliseconds.
|
TransactionConfiguration |
setPessimisticTxLogSize(int pessimisticTxLogSize)
Sets pessimistic transactions log size.
|
<T> TransactionConfiguration |
setTxManagerFactory(javax.cache.configuration.Factory<T> factory)
Sets transaction manager factory for available
javax.transaction.TransactionManager implementation,
if any. |
TransactionConfiguration |
setTxManagerLookupClassName(String tmLookupClsName)
Deprecated.
Use
setTxManagerFactory(Factory) instead. |
TransactionConfiguration |
setTxSerializableEnabled(boolean txSerEnabled)
Deprecated.
This method has no effect,
TransactionIsolation.SERIALIZABLE isolation is always enabled. |
TransactionConfiguration |
setTxTimeoutOnPartitionMapExchange(long txTimeoutOnPartitionMapExchange)
Sets transaction timeout on partition map exchange.
0 means transactions will never be rolled back on partition map exchange.
|
TransactionConfiguration |
setUseJtaSynchronization(boolean useJtaSync)
Sets the flag that defines whether to use lightweight JTA synchronization callback to enlist
into JTA transaction instead of creating a separate XA resource.
|
String |
toString() |
public static final boolean DFLT_TX_SERIALIZABLE_ENABLED
public static final TransactionConcurrency DFLT_TX_CONCURRENCY
public static final TransactionIsolation DFLT_TX_ISOLATION
public static final long DFLT_TRANSACTION_TIMEOUT
public static final long TX_TIMEOUT_ON_PARTITION_MAP_EXCHANGE
public static final long DFLT_DEADLOCK_TIMEOUT
public static final int DFLT_PESSIMISTIC_TX_LOG_LINGER
public TransactionConfiguration()
public TransactionConfiguration(TransactionConfiguration cfg)
cfg
- Configuration to copy.@Deprecated public boolean isTxSerializableEnabled()
TransactionIsolation.SERIALIZABLE
isolation
level for cache transactions. Serializable level does carry certain overhead and
if not used, should be disabled. Default value is false
.True
if serializable transactions are enabled, false
otherwise.@Deprecated public TransactionConfiguration setTxSerializableEnabled(boolean txSerEnabled)
TransactionIsolation.SERIALIZABLE
isolation is always enabled.txSerEnabled
- Flag to enable/disable serializable cache transactions.this
for chaining.public TransactionConcurrency getDefaultTxConcurrency()
DFLT_TX_CONCURRENCY
.Transaction
public TransactionConfiguration setDefaultTxConcurrency(TransactionConcurrency dfltConcurrency)
dfltConcurrency
- Default cache transaction concurrency.this
for chaining.public TransactionIsolation getDefaultTxIsolation()
DFLT_TX_ISOLATION
.Transaction
public TransactionConfiguration setDefaultTxIsolation(TransactionIsolation dfltIsolation)
dfltIsolation
- Default cache transaction isolation.this
for chaining.public long getDefaultTxTimeout()
DFLT_TRANSACTION_TIMEOUT
which is 0
and means that transactions will never time out.public TransactionConfiguration setDefaultTxTimeout(long dfltTxTimeout)
DFLT_TRANSACTION_TIMEOUT
.dfltTxTimeout
- Default transaction timeout.this
for chaining.public long getTxTimeoutOnPartitionMapExchange()
When the partition map exchange starts, Ignite acquires a global lock at a particular stage. The lock can't be obtained until pending transactions are running in parallel. If there is a transaction that runs for a while, then it will prevent the partition map exchange process from the start freezing some operations such as a new node join process.
This property allows to rollback such long transactions to let Ignite acquire the lock faster and initiate the partition map exchange process. The timeout is enforced only at the time of the partition map exchange process.
0 means transactions will never be rolled back on partition map exchange.
Default value is TX_TIMEOUT_ON_PARTITION_MAP_EXCHANGE
.
public TransactionConfiguration setTxTimeoutOnPartitionMapExchange(long txTimeoutOnPartitionMapExchange)
txTimeoutOnPartitionMapExchange
- Transaction timeout value in milliseconds.this
for chaining.public long getDeadlockTimeout()
Transaction deadlocks occurred for caches configured with CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT
can be resolved automatically.
Deadlock detection starts when one transaction is waiting for an entry lock more than a timeout specified by this property.
Timeout is specified in milliseconds and 0
means that automatic deadlock detection is disabled. Default
value is defined by DFLT_DEADLOCK_TIMEOUT
.
public TransactionConfiguration setDeadlockTimeout(long deadlockTimeout)
Sets a timeout before starting deadlock detection for caches configured with
CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT
.
Timeout is specified in milliseconds and 0
means that automatic deadlock detection is disabled. Default
value is defined by DFLT_DEADLOCK_TIMEOUT
.
deadlockTimeout
- Timeout value in milliseconds.this
for chaining.public int getPessimisticTxLogSize()
If not set, default value is 0
which means unlimited log size.
public TransactionConfiguration setPessimisticTxLogSize(int pessimisticTxLogSize)
pessimisticTxLogSize
- Pessimistic transactions log size.this
for chaining.getPessimisticTxLogSize()
public int getPessimisticTxLogLinger()
If not set, default value is DFLT_PESSIMISTIC_TX_LOG_LINGER
.
public TransactionConfiguration setPessimisticTxLogLinger(int pessimisticTxLogLinger)
pessimisticTxLogLinger
- Pessimistic log cleanup delay.this
for chaining.getPessimisticTxLogLinger()
@Deprecated public String getTxManagerLookupClassName()
getTxManagerFactory()
instead.@Deprecated public TransactionConfiguration setTxManagerLookupClassName(String tmLookupClsName)
setTxManagerFactory(Factory)
instead.TransactionManager
implementation, if any.tmLookupClsName
- Name of class implementing GridCacheTmLookup interface that is used to
receive JTA transaction manager.this
for chaining.public <T> javax.cache.configuration.Factory<T> getTxManagerFactory()
T
- Instance of javax.transaction.TransactionManager
.isUseJtaSynchronization()
public <T> TransactionConfiguration setTxManagerFactory(javax.cache.configuration.Factory<T> factory)
javax.transaction.TransactionManager
implementation,
if any.
It allows to use different transactional systems. Implement factory that produce native
javax.transaction.TransactionManager
within your environment.
The following implementations are provided out of the box (jta module must be enabled):
org.apache.ignite.cache.jta.jndi.CacheJndiTmFactory
utilizes configured JNDI names to look up
a transaction manager.
org.apache.ignite.cache.jta.websphere.WebSphereTmFactory
an implementation of Transaction Manager
factory to be used within WebSphere Application Server.
org.apache.ignite.cache.jta.websphere.WebSphereLibertyTmFactory
an implementation of Transaction Manager
factory to be used within WebSphere Liberty.
Factory.create()
method throws any exception,
returns null
-value or returns non-TransactionManager
instance.T
- Instance of javax.transaction.TransactionManager
.factory
- Transaction manager factory.this
for chaining.setUseJtaSynchronization(boolean)
public boolean isUseJtaSynchronization()
javax.transaction.Synchronization
instead of javax.transaction.xa.XAResource
.getTxManagerFactory()
public TransactionConfiguration setUseJtaSynchronization(boolean useJtaSync)
useJtaSync
- Whether to use JTA javax.transaction.Synchronization
instead of javax.transaction.xa.XAResource
.this
for chaining.setTxManagerFactory(Factory)
public boolean equals(Object o)
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024