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
-
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 ConfigurationBuilder
indexing()
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()
boolean
simpleCache
(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()
boolean
use1PcForAutoCommitTransactions
(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.void
validate()
Validate the data in this builder before building the configuration beanvoid
validate
(GlobalConfiguration globalConfig) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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,Synchronization
s are used rather thanXAResource
s 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 (
TransactionRegistered
andTransactionCompleted
) triggered?
-
attributes
- Specified by:
attributes
in interfaceBuilder<TransactionConfiguration>
-
validate
public void validate()Description copied from interface:Builder
Validate the data in this builder before building the configuration bean- Specified by:
validate
in interfaceBuilder<TransactionConfiguration>
-
validate
- Specified by:
validate
in interfaceConfigurationChildBuilder
-
create
Description copied from interface:Builder
Create the configuration bean- Specified by:
create
in interfaceBuilder<TransactionConfiguration>
- Returns:
-
read
Description copied from interface:Builder
Reads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration- Specified by:
read
in 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:
template
in interfaceConfigurationChildBuilder
-
simpleCache
- Specified by:
simpleCache
in interfaceConfigurationChildBuilder
-
simpleCache
public boolean simpleCache()- Specified by:
simpleCache
in interfaceConfigurationChildBuilder
-
clustering
- Specified by:
clustering
in 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:
customInterceptors
in interfaceConfigurationChildBuilder
-
encoding
- Specified by:
encoding
in interfaceConfigurationChildBuilder
-
expiration
- Specified by:
expiration
in interfaceConfigurationChildBuilder
-
query
- Specified by:
query
in interfaceConfigurationChildBuilder
-
indexing
- Specified by:
indexing
in interfaceConfigurationChildBuilder
-
invocationBatching
- Specified by:
invocationBatching
in interfaceConfigurationChildBuilder
-
statistics
- Specified by:
statistics
in interfaceConfigurationChildBuilder
-
persistence
- Specified by:
persistence
in interfaceConfigurationChildBuilder
-
locking
- Specified by:
locking
in interfaceConfigurationChildBuilder
-
security
- Specified by:
security
in interfaceConfigurationChildBuilder
-
transaction
- Specified by:
transaction
in interfaceConfigurationChildBuilder
-
unsafe
- Specified by:
unsafe
in interfaceConfigurationChildBuilder
-
sites
- Specified by:
sites
in interfaceConfigurationChildBuilder
-
memory
- Specified by:
memory
in interfaceConfigurationChildBuilder
-
getBuilder
-
build
- Specified by:
build
in interfaceConfigurationChildBuilder
-