Class TransactionConfigurationBuilder
java.lang.Object
org.infinispan.configuration.cache.TransactionConfigurationBuilder
- All Implemented Interfaces:
Builder<TransactionConfiguration>,ConfigurationChildBuilder
public class TransactionConfigurationBuilder
extends Object
implements Builder<TransactionConfiguration>
Defines transactional (JTA) characteristics of the cache.
- Author:
- pmuir, Pedro Ruivo
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionautoCommit(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()Create the configuration beanDeprecated, for removal: This API element is subject to removal in a future version.Since 10.0, custom interceptors support will be removed and only modules will be able to define interceptorsencoding()protected ConfigurationBuilderindexing()locking()lockingMode(LockingMode lockingMode) Configures whether the cache uses optimistic or pessimistic locking.memory()notifications(boolean enabled) query()read(TransactionConfiguration template, Combine combine) Reads the configuration from an already created configuration bean into this builder.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()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()Validate the data in this builder before building the configuration beanvoidvalidate(GlobalConfiguration globalConfig) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.infinispan.configuration.cache.ConfigurationChildBuilder
jmxStatistics
-
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. -
transactionManagerLookup
Configure Transaction manager lookup directly using an instance of TransactionManagerLookup. Calling this method marks the cache as transactional. -
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
- Specified by:
attributesin interfaceBuilder<TransactionConfiguration>
-
validate
public void validate()Description copied from interface:BuilderValidate the data in this builder before building the configuration bean- Specified by:
validatein interfaceBuilder<TransactionConfiguration>
-
validate
- Specified by:
validatein interfaceConfigurationChildBuilder
-
create
Description copied from interface:BuilderCreate the configuration bean- Specified by:
createin interfaceBuilder<TransactionConfiguration>- Returns:
-
read
Description copied from interface:BuilderReads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration- Specified by:
readin interfaceBuilder<TransactionConfiguration>- Parameters:
template- the configuration from which to "clone" this config if needed.combine- the way attributes and children of this instance and the template should be combined.
-
toString
-
template
- Specified by:
templatein interfaceConfigurationChildBuilder
-
simpleCache
- Specified by:
simpleCachein interfaceConfigurationChildBuilder
-
simpleCache
public boolean simpleCache()- Specified by:
simpleCachein interfaceConfigurationChildBuilder
-
clustering
- Specified by:
clusteringin interfaceConfigurationChildBuilder
-
customInterceptors
Deprecated, for removal: This API element is subject to removal in a future version.Since 10.0, custom interceptors support will be removed and only modules will be able to define interceptors- Specified by:
customInterceptorsin interfaceConfigurationChildBuilder
-
encoding
- Specified by:
encodingin interfaceConfigurationChildBuilder
-
expiration
- Specified by:
expirationin interfaceConfigurationChildBuilder
-
query
- Specified by:
queryin interfaceConfigurationChildBuilder
-
indexing
- Specified by:
indexingin 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
-