Class TransactionConfiguration
java.lang.Object
org.infinispan.commons.configuration.attributes.ConfigurationElement<TransactionConfiguration>
org.infinispan.configuration.cache.TransactionConfiguration
- All Implemented Interfaces:
Matchable<TransactionConfiguration>
,Updatable<TransactionConfiguration>
Defines transactional (JTA) characteristics of the cache.
- Author:
- pmuir, Pedro Ruivo
-
Field Summary
Modifier and TypeFieldDescriptionstatic final AttributeDefinition
<Boolean> static final AttributeDefinition
<Long> static final AttributeDefinition
<Long> static final AttributeDefinition
<LockingMode> static final AttributeDefinition
<Boolean> static final AttributeDefinition
<Long> static final AttributeDefinition
<TransactionManagerLookup> static final AttributeDefinition
<TransactionMode> static final AttributeDefinition
<TransactionSynchronizationRegistryLookup> static final AttributeDefinition
<Boolean> static final AttributeDefinition
<Boolean> Fields inherited from class org.infinispan.commons.configuration.attributes.ConfigurationElement
attributes, CHILDLESS, children, element, repeated
-
Method Summary
Modifier and TypeMethodDescriptionboolean
If the cache is transactional (i.e.long
If there are any ongoing transactions when a cache is stopped, Infinispan waits for ongoing remote and local transactions to finish.cacheStopTimeout
(long l) If there are any ongoing transactions when a cache is stopped, Infinispan waits for ongoing remote and local transactions to finish.long
Configures whether the cache uses optimistic or pessimistic locking.lockingMode
(LockingMode lockingMode) Configures whether the cache uses optimistic or pessimistic locking.boolean
long
recovery()
This method allows configuration of the transaction recovery cache.Configure Transaction manager lookup directly using an instance of TransactionManagerLookup.Configure Transaction Synchronization Registry lookup directly using an instance of TransactionManagerLookup.boolean
Before Infinispan 5.1 you could access the cache both transactionally and non-transactionally.boolean
Methods inherited from class org.infinispan.commons.configuration.attributes.ConfigurationElement
attributes, child, children, children, elementName, equals, findAttribute, hashCode, isModified, list, matches, toString, update, validateUpdate, write
-
Field Details
-
AUTO_COMMIT
-
CACHE_STOP_TIMEOUT
-
LOCKING_MODE
-
TRANSACTION_MANAGER_LOOKUP
-
TRANSACTION_SYNCHRONIZATION_REGISTRY_LOOKUP
public static final AttributeDefinition<TransactionSynchronizationRegistryLookup> TRANSACTION_SYNCHRONIZATION_REGISTRY_LOOKUP -
TRANSACTION_MODE
-
USE_SYNCHRONIZATION
-
USE_1_PC_FOR_AUTO_COMMIT_TRANSACTIONS
-
REAPER_WAKE_UP_INTERVAL
-
COMPLETED_TX_TIMEOUT
-
NOTIFICATIONS
-
-
Method Details
-
autoCommit
public boolean autoCommit()If the cache is transactional (i.e.transactionMode()
== TransactionMode.TRANSACTIONAL) and transactionAutoCommit is enabled then for single operation transactions the user doesn't need to manually start a transaction, but a transactions is injected by the system. Defaults to true. -
cacheStopTimeout
If there are any ongoing transactions when a cache is stopped, Infinispan waits for ongoing remote and local transactions to finish. The amount of time to wait for is defined by the cache stop timeout. It is recommended that this value does not exceed the transaction timeout because even if a new transaction was started just before the cache was stopped, this could only last as long as the transaction timeout allows it. -
cacheStopTimeout
public long cacheStopTimeout()If there are any ongoing transactions when a cache is stopped, Infinispan waits for ongoing remote and local transactions to finish. The amount of time to wait for is defined by the cache stop timeout. It is recommended that this value does not exceed the transaction timeout because even if a new transaction was started just before the cache was stopped, this could only last as long as the transaction timeout allows it. -
lockingMode
Configures whether the cache uses optimistic or pessimistic locking. If the cache is not transactional then the locking mode is ignored.- See Also:
-
lockingMode
Configures whether the cache uses optimistic or pessimistic locking. If the cache is not transactional then the locking mode is ignored.- See Also:
-
transactionManagerLookup
Configure Transaction manager lookup directly using an instance of TransactionManagerLookup. Calling this method marks the cache as transactional. -
transactionSynchronizationRegistryLookup
Configure Transaction Synchronization Registry lookup directly using an instance of TransactionManagerLookup. Calling this method marks the cache as transactional. -
transactionMode
-
useSynchronization
public boolean useSynchronization() -
recovery
This method allows configuration of the transaction recovery cache. When this method is called, it automatically enables recovery. So, if you want it to be disabled, make sure you callRecoveryConfigurationBuilder.enabled(boolean)
with false as parameter -
reaperWakeUpInterval
public long reaperWakeUpInterval()- See Also:
-
completedTxTimeout
public long completedTxTimeout()- See Also:
-
use1PcForAutoCommitTransactions
public boolean use1PcForAutoCommitTransactions()Before Infinispan 5.1 you could access the cache both transactionally and non-transactionally. Naturally the non-transactional access is faster and offers less consistency guarantees. From Infinispan 5.1 onwards, mixed access is no longer supported, so if you wanna speed up transactional caches and you're ready to trade some consistency guarantees, you can enable use1PcForAutoCommitTransactions.What this configuration option does is force an induced transaction, that has been started by Infinispan as a result of enabling autoCommit, to commit in a single phase. So only 1 RPC instead of 2RPCs as in the case of a full 2 Phase Commit (2PC).
N.B. this option should NOT be used when modifying the same key from multiple transactions as 1PC does not offer any consistency guarantees under concurrent access. -
notifications
public boolean notifications()- Returns:
- are transactional notifications (
TransactionRegistered
andTransactionCompleted
) triggered?
-