public class TransactionConfiguration extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static int |
DFLT_PESSIMISTIC_TX_LOG_LINGER
Deprecated.
Pessimistic tx log linger property has no effect.
|
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 |
---|---|
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()
Deprecated.
Pessimistic tx log linger property has no effect.
|
int |
getPessimisticTxLogSize()
Deprecated.
Pessimistic tx log size property has no effect.
|
<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.
|
boolean |
isTxSerializableEnabled()
Deprecated.
|
boolean |
isUseJtaSynchronization() |
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)
Deprecated.
Pessimistic tx log linger property has no effect.
|
TransactionConfiguration |
setPessimisticTxLogSize(int pessimisticTxLogSize)
Deprecated.
Pessimistic tx log size property has no effect.
|
<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 the transaction timeout that will be enforced if the partition map exchange process starts.
|
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 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.
If not set, default value is TX_TIMEOUT_ON_PARTITION_MAP_EXCHANGE
which means transactions will never be
rolled back on partition map exchange.
public TransactionConfiguration setTxTimeoutOnPartitionMapExchange(long txTimeoutOnPartitionMapExchange)
txTimeoutOnPartitionMapExchange
- Transaction timeout value in milliseconds.this
for chaining.@Deprecated public int getPessimisticTxLogSize()
If not set, default value is 0
which means unlimited log size.
@Deprecated public TransactionConfiguration setPessimisticTxLogSize(int pessimisticTxLogSize)
pessimisticTxLogSize
- Pessimistic transactions log size.this
for chaining.getPessimisticTxLogSize()
@Deprecated public int getPessimisticTxLogLinger()
If not set, default value is DFLT_PESSIMISTIC_TX_LOG_LINGER
.
@Deprecated 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)
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023