Class TransactionConfigurationBuilder
java.lang.Object
org.infinispan.configuration.cache.TransactionConfigurationBuilder
- All Implemented Interfaces:
org.infinispan.commons.configuration.Builder<TransactionConfiguration>,ConfigurationChildBuilder
public class TransactionConfigurationBuilder
extends Object
implements org.infinispan.commons.configuration.Builder<TransactionConfiguration>
Defines transactional (JTA) characteristics of the cache.
- Author:
- pmuir, Pedro Ruivo
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionorg.infinispan.commons.configuration.attributes.AttributeSetautoCommit(boolean b) If the cache is transactional (i.e.build()cacheStopTimeout(long l) If there are any ongoing transactions when a cache is stopped, Infinispan waits for ongoing remote and local transactions to finish.cacheStopTimeout(long l, TimeUnit unit) If there are any ongoing transactions when a cache is stopped, Infinispan waits for ongoing remote and local transactions to finish.completedTxTimeout(long timeout) The duration (millis) in which to keep information about the completion of a transaction.create()encoding()protected ConfigurationBuilderindexing()locking()lockingMode(LockingMode lockingMode) Configures whether the cache uses optimistic or pessimistic locking.memory()notifications(boolean enabled) query()read(TransactionConfiguration template, org.infinispan.commons.configuration.Combine combine) reaperWakeUpInterval(long interval) The time interval (millis) at which the thread that cleans up transaction completion information kicks in.recovery()This method allows configuration of the transaction recovery cache.security()booleansimpleCache(boolean simpleCache) sites()template(boolean template) toString()tracing()org.infinispan.commons.tx.lookup.TransactionManagerLookuptransactionManagerLookup(org.infinispan.commons.tx.lookup.TransactionManagerLookup tml) Configure Transaction manager lookup directly using an instance of TransactionManagerLookup.transactionMode(TransactionMode transactionMode) Configure Transaction Synchronization Registry lookup directly using an instance of TransactionManagerLookup.unsafe()booleanuse1PcForAutoCommitTransactions(boolean b) Before Infinispan 5.1 you could access the cache both transactionally and non-transactionally.useSynchronization(boolean b) Configures whether the cache registers a synchronization with the transaction manager, or registers itself as an XA resource.voidvalidate()voidvalidate(GlobalConfiguration globalConfig) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.infinispan.commons.configuration.Builder
read, reset
-
Field Details
-
builder
-
-
Method Details
-
autoCommit
If the cache is transactional (i.e.transactionMode(org.infinispan.transaction.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. This configuration property may be adjusted at runtime -
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. This configuration property may be adjusted at runtime -
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
public TransactionConfigurationBuilder transactionManagerLookup(org.infinispan.commons.tx.lookup.TransactionManagerLookup tml) Configure Transaction manager lookup directly using an instance of TransactionManagerLookup. Calling this method marks the cache as transactional. -
transactionManagerLookup
public org.infinispan.commons.tx.lookup.TransactionManagerLookup transactionManagerLookup() -
transactionSynchronizationRegistryLookup
public TransactionConfigurationBuilder transactionSynchronizationRegistryLookup(TransactionSynchronizationRegistryLookup lookup) Configure Transaction Synchronization Registry lookup directly using an instance of TransactionManagerLookup. Calling this method marks the cache as transactional. -
transactionMode
-
transactionMode
-
useSynchronization
Configures whether the cache registers a synchronization with the transaction manager, or registers itself as an XA resource. It is often unnecessary to register as a full XA resource unless you intend to make use of recovery as well, and registering a synchronization is significantly more efficient.- Parameters:
b- if true,Synchronizations are used rather thanXAResources when communicating with aTransactionManager.
-
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.disable())} -
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). -
use1PcForAutoCommitTransactions
public boolean use1PcForAutoCommitTransactions() -
reaperWakeUpInterval
The time interval (millis) at which the thread that cleans up transaction completion information kicks in. Defaults to 30000. -
completedTxTimeout
The duration (millis) in which to keep information about the completion of a transaction. Defaults to 60000. -
notifications
- Returns:
- are transactional notifications (
TransactionRegisteredandTransactionCompleted) triggered?
-
attributes
public org.infinispan.commons.configuration.attributes.AttributeSet attributes()- Specified by:
attributesin interfaceorg.infinispan.commons.configuration.Builder<TransactionConfiguration>
-
validate
public void validate()- Specified by:
validatein interfaceorg.infinispan.commons.configuration.Builder<TransactionConfiguration>
-
validate
- Specified by:
validatein interfaceConfigurationChildBuilder
-
create
- Specified by:
createin interfaceorg.infinispan.commons.configuration.Builder<TransactionConfiguration>
-
read
public TransactionConfigurationBuilder read(TransactionConfiguration template, org.infinispan.commons.configuration.Combine combine) - Specified by:
readin interfaceorg.infinispan.commons.configuration.Builder<TransactionConfiguration>
-
toString
-
aliases
- Specified by:
aliasesin interfaceConfigurationChildBuilder
-
template
- Specified by:
templatein interfaceConfigurationChildBuilder
-
simpleCache
- Specified by:
simpleCachein interfaceConfigurationChildBuilder
-
simpleCache
public boolean simpleCache()- Specified by:
simpleCachein interfaceConfigurationChildBuilder
-
clustering
- Specified by:
clusteringin interfaceConfigurationChildBuilder
-
encoding
- Specified by:
encodingin interfaceConfigurationChildBuilder
-
expiration
- Specified by:
expirationin interfaceConfigurationChildBuilder
-
query
- Specified by:
queryin interfaceConfigurationChildBuilder
-
indexing
- Specified by:
indexingin interfaceConfigurationChildBuilder
-
tracing
- Specified by:
tracingin interfaceConfigurationChildBuilder
-
invocationBatching
- Specified by:
invocationBatchingin interfaceConfigurationChildBuilder
-
statistics
- Specified by:
statisticsin interfaceConfigurationChildBuilder
-
persistence
- Specified by:
persistencein interfaceConfigurationChildBuilder
-
locking
- Specified by:
lockingin interfaceConfigurationChildBuilder
-
security
- Specified by:
securityin interfaceConfigurationChildBuilder
-
transaction
- Specified by:
transactionin interfaceConfigurationChildBuilder
-
unsafe
- Specified by:
unsafein interfaceConfigurationChildBuilder
-
sites
- Specified by:
sitesin interfaceConfigurationChildBuilder
-
memory
- Specified by:
memoryin interfaceConfigurationChildBuilder
-
getBuilder
-
build
- Specified by:
buildin interfaceConfigurationChildBuilder
-