Class TransactionConfiguration
- java.lang.Object
- 
- org.infinispan.configuration.cache.TransactionConfiguration
 
- 
- All Implemented Interfaces:
- org.infinispan.commons.configuration.attributes.Matchable<TransactionConfiguration>,- BaseConfigurationInfo,- ConfigurationInfo
 
 public class TransactionConfiguration extends Object implements org.infinispan.commons.configuration.attributes.Matchable<TransactionConfiguration>, ConfigurationInfo Defines transactional (JTA) characteristics of the cache.- Author:
- pmuir, Pedro Ruivo
 
- 
- 
Field SummaryFields Modifier and Type Field Description static org.infinispan.commons.configuration.attributes.AttributeDefinition<Boolean>AUTO_COMMITstatic org.infinispan.commons.configuration.attributes.AttributeDefinition<Long>CACHE_STOP_TIMEOUTstatic org.infinispan.commons.configuration.attributes.AttributeDefinition<Long>COMPLETED_TX_TIMEOUTstatic org.infinispan.commons.configuration.elements.ElementDefinitionELEMENT_DEFINTIONstatic org.infinispan.commons.configuration.attributes.AttributeDefinition<LockingMode>LOCKING_MODEstatic org.infinispan.commons.configuration.attributes.AttributeDefinition<Boolean>NOTIFICATIONSstatic org.infinispan.commons.configuration.attributes.AttributeDefinition<Long>REAPER_WAKE_UP_INTERVALstatic org.infinispan.commons.configuration.attributes.AttributeDefinition<org.infinispan.commons.tx.lookup.TransactionManagerLookup>TRANSACTION_MANAGER_LOOKUPstatic org.infinispan.commons.configuration.attributes.AttributeDefinition<TransactionMode>TRANSACTION_MODEstatic org.infinispan.commons.configuration.attributes.AttributeDefinition<TransactionProtocol>TRANSACTION_PROTOCOLstatic org.infinispan.commons.configuration.attributes.AttributeDefinition<org.infinispan.transaction.lookup.TransactionSynchronizationRegistryLookup>TRANSACTION_SYNCHRONIZATION_REGISTRY_LOOKUPstatic org.infinispan.commons.configuration.attributes.AttributeDefinition<Boolean>USE_1_PC_FOR_AUTO_COMMIT_TRANSACTIONSstatic org.infinispan.commons.configuration.attributes.AttributeDefinition<Boolean>USE_SYNCHRONIZATION
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.infinispan.commons.configuration.attributes.AttributeSetattributes()booleanautoCommit()If the cache is transactional (i.e.longcacheStopTimeout()If there are any ongoing transactions when a cache is stopped, Infinispan waits for ongoing remote and local transactions to finish.TransactionConfigurationcacheStopTimeout(long l)If there are any ongoing transactions when a cache is stopped, Infinispan waits for ongoing remote and local transactions to finish.longcompletedTxTimeout()booleanequals(Object obj)org.infinispan.commons.configuration.elements.ElementDefinitiongetElementDefinition()inthashCode()LockingModelockingMode()Configures whether the cache uses optimistic or pessimistic locking.TransactionConfigurationlockingMode(LockingMode lockingMode)Configures whether the cache uses optimistic or pessimistic locking.booleanmatches(TransactionConfiguration other)booleannotifications()longreaperWakeUpInterval()RecoveryConfigurationrecovery()This method allows configuration of the transaction recovery cache.List<ConfigurationInfo>subElements()StringtoString()org.infinispan.commons.tx.lookup.TransactionManagerLookuptransactionManagerLookup()Configure Transaction manager lookup directly using an instance of TransactionManagerLookup.TransactionModetransactionMode()TransactionProtocoltransactionProtocol()Deprecated.since 10.0.org.infinispan.transaction.lookup.TransactionSynchronizationRegistryLookuptransactionSynchronizationRegistryLookup()Configure Transaction Synchronization Registry lookup directly using an instance of TransactionManagerLookup.booleanuse1PcForAutoCommitTransactions()Before Infinispan 5.1 you could access the cache both transactionally and non-transactionally.booleanuseSynchronization()
 
- 
- 
- 
Field Detail- 
AUTO_COMMITpublic static final org.infinispan.commons.configuration.attributes.AttributeDefinition<Boolean> AUTO_COMMIT 
 - 
CACHE_STOP_TIMEOUTpublic static final org.infinispan.commons.configuration.attributes.AttributeDefinition<Long> CACHE_STOP_TIMEOUT 
 - 
LOCKING_MODEpublic static final org.infinispan.commons.configuration.attributes.AttributeDefinition<LockingMode> LOCKING_MODE 
 - 
TRANSACTION_MANAGER_LOOKUPpublic static final org.infinispan.commons.configuration.attributes.AttributeDefinition<org.infinispan.commons.tx.lookup.TransactionManagerLookup> TRANSACTION_MANAGER_LOOKUP 
 - 
TRANSACTION_SYNCHRONIZATION_REGISTRY_LOOKUPpublic static final org.infinispan.commons.configuration.attributes.AttributeDefinition<org.infinispan.transaction.lookup.TransactionSynchronizationRegistryLookup> TRANSACTION_SYNCHRONIZATION_REGISTRY_LOOKUP 
 - 
TRANSACTION_MODEpublic static final org.infinispan.commons.configuration.attributes.AttributeDefinition<TransactionMode> TRANSACTION_MODE 
 - 
USE_SYNCHRONIZATIONpublic static final org.infinispan.commons.configuration.attributes.AttributeDefinition<Boolean> USE_SYNCHRONIZATION 
 - 
USE_1_PC_FOR_AUTO_COMMIT_TRANSACTIONSpublic static final org.infinispan.commons.configuration.attributes.AttributeDefinition<Boolean> USE_1_PC_FOR_AUTO_COMMIT_TRANSACTIONS 
 - 
REAPER_WAKE_UP_INTERVALpublic static final org.infinispan.commons.configuration.attributes.AttributeDefinition<Long> REAPER_WAKE_UP_INTERVAL 
 - 
COMPLETED_TX_TIMEOUTpublic static final org.infinispan.commons.configuration.attributes.AttributeDefinition<Long> COMPLETED_TX_TIMEOUT 
 - 
TRANSACTION_PROTOCOLpublic static final org.infinispan.commons.configuration.attributes.AttributeDefinition<TransactionProtocol> TRANSACTION_PROTOCOL 
 - 
NOTIFICATIONSpublic static final org.infinispan.commons.configuration.attributes.AttributeDefinition<Boolean> NOTIFICATIONS 
 - 
ELEMENT_DEFINTIONpublic static final org.infinispan.commons.configuration.elements.ElementDefinition ELEMENT_DEFINTION 
 
- 
 - 
Method Detail- 
autoCommitpublic 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.
 - 
cacheStopTimeoutpublic TransactionConfiguration cacheStopTimeout(long l) 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.
 - 
cacheStopTimeoutpublic 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.
 - 
lockingModepublic LockingMode lockingMode() Configures whether the cache uses optimistic or pessimistic locking. If the cache is not transactional then the locking mode is ignored.- See Also:
- transactionMode()
 
 - 
lockingModepublic TransactionConfiguration lockingMode(LockingMode lockingMode) Configures whether the cache uses optimistic or pessimistic locking. If the cache is not transactional then the locking mode is ignored.- See Also:
- transactionMode()
 
 - 
transactionManagerLookuppublic org.infinispan.commons.tx.lookup.TransactionManagerLookup transactionManagerLookup() Configure Transaction manager lookup directly using an instance of TransactionManagerLookup. Calling this method marks the cache as transactional.
 - 
transactionSynchronizationRegistryLookuppublic org.infinispan.transaction.lookup.TransactionSynchronizationRegistryLookup transactionSynchronizationRegistryLookup() Configure Transaction Synchronization Registry lookup directly using an instance of TransactionManagerLookup. Calling this method marks the cache as transactional.
 - 
transactionModepublic TransactionMode transactionMode() 
 - 
useSynchronizationpublic boolean useSynchronization() 
 - 
recoverypublic RecoveryConfiguration 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
 - 
reaperWakeUpIntervalpublic long reaperWakeUpInterval() 
 - 
completedTxTimeoutpublic long completedTxTimeout() 
 - 
use1PcForAutoCommitTransactionspublic 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.
 - 
transactionProtocol@Deprecated public TransactionProtocol transactionProtocol() Deprecated.since 10.0. Total Order will be removed.- Returns:
- the transaction protocol in use (2PC or Total Order)
 
 - 
notificationspublic boolean notifications() - Returns:
- are transactional notifications (
    TransactionRegisteredandTransactionCompleted) triggered?
 
 - 
attributespublic org.infinispan.commons.configuration.attributes.AttributeSet attributes() - Specified by:
- attributesin interface- BaseConfigurationInfo
- Returns:
- the AttributeSetdeclared by the configuration.
 
 - 
getElementDefinitionpublic org.infinispan.commons.configuration.elements.ElementDefinition getElementDefinition() - Specified by:
- getElementDefinitionin interface- BaseConfigurationInfo
- Returns:
- the ElementDefinitionof the configuration.
 
 - 
toStringpublic String toString() 
 - 
equalspublic boolean equals(Object obj) 
 - 
subElementspublic List<ConfigurationInfo> subElements() - Specified by:
- subElementsin interface- ConfigurationInfo
- Returns:
- the list of sub elements.
 
 - 
matchespublic boolean matches(TransactionConfiguration other) 
 - 
hashCodepublic int hashCode() 
 
- 
 
-