org.infinispan.config
Interface Configuration.TransactionConfig

All Known Implementing Classes:
Configuration.TransactionType
Enclosing class:
Configuration

public static interface Configuration.TransactionConfig

Defines transactional (JTA) characteristics of the cache.

Since:
5.0
Author:
Vladimir Blagojevic

Method Summary
 Configuration.TransactionConfig cacheStopTimeout(Integer cacheStopTimeout)
          If there are any ongoing transactions when a cache is stopped, Infinispan waits for ongoing remote and local transactions to finish.
 Configuration.TransactionConfig eagerLockSingleNode(Boolean eagerLockSingleNode)
          Only has effect for DIST mode and when useEagerLocking is set to true.
 Configuration.TransactionConfig syncCommitPhase(Boolean syncCommitPhase)
          If true, the cluster-wide commit phase in two-phase commit (2PC) transactions will be synchronous, so Infinispan will wait for responses from all nodes to which the commit was sent.
 Configuration.TransactionConfig syncRollbackPhase(Boolean syncRollbackPhase)
          If true, the cluster-wide rollback phase in two-phase commit (2PC) transactions will be synchronous, so Infinispan will wait for responses from all nodes to which the rollback was sent.
 Configuration.TransactionConfig transactionManagerLookupClass(Class<? extends TransactionManagerLookup> transactionManagerLookupClass)
          Fully qualified class name of a class that looks up a reference to a TransactionManager.
 Configuration.TransactionConfig useEagerLocking(Boolean useEagerLocking)
          Only has effect for DIST mode and when useEagerLocking is set to true.
 Configuration.TransactionConfig usingTransactionManagerLookup(TransactionManagerLookup transactionManagerLookup)
          Configure Transaction manager lookup directly using an instance of TransactionManagerLookup
 

Method Detail

transactionManagerLookupClass

Configuration.TransactionConfig transactionManagerLookupClass(Class<? extends TransactionManagerLookup> transactionManagerLookupClass)
Fully qualified class name of a class that looks up a reference to a TransactionManager. The default provided is capable of locating the default TransactionManager in most popular Java EE systems, using a JNDI lookup.

Parameters:
transactionManagerLookupClass -

syncCommitPhase

Configuration.TransactionConfig syncCommitPhase(Boolean syncCommitPhase)
If true, the cluster-wide commit phase in two-phase commit (2PC) transactions will be synchronous, so Infinispan will wait for responses from all nodes to which the commit was sent. Otherwise, the commit phase will be asynchronous. Keeping it as false improves performance of 2PC transactions, since any remote failures are trapped during the prepare phase anyway and appropriate rollbacks are issued.

Parameters:
syncCommitPhase -

syncRollbackPhase

Configuration.TransactionConfig syncRollbackPhase(Boolean syncRollbackPhase)
If true, the cluster-wide rollback phase in two-phase commit (2PC) transactions will be synchronous, so Infinispan will wait for responses from all nodes to which the rollback was sent. Otherwise, the rollback phase will be asynchronous. Keeping it as false improves performance of 2PC transactions.

Parameters:
syncRollbackPhase -

useEagerLocking

Configuration.TransactionConfig useEagerLocking(Boolean useEagerLocking)
Only has effect for DIST mode and when useEagerLocking is set to true. When this is enabled, then only one node is locked in the cluster, disregarding numOwners config. On the opposite, if this is false, then on all cache.lock() calls numOwners RPCs are being performed. The node that gets locked is the main data owner, i.e. the node where data would reside if numOwners==1. If the node where the lock resides crashes, then the transaction is marked for rollback - data is in a consistent state, no fault tolerance.

Parameters:
useEagerLocking -

usingTransactionManagerLookup

Configuration.TransactionConfig usingTransactionManagerLookup(TransactionManagerLookup transactionManagerLookup)
Configure Transaction manager lookup directly using an instance of TransactionManagerLookup

Parameters:
transactionManagerLookup - instance to use as lookup
Returns:
this TransactionConfig

eagerLockSingleNode

Configuration.TransactionConfig eagerLockSingleNode(Boolean eagerLockSingleNode)
Only has effect for DIST mode and when useEagerLocking is set to true. When this is enabled, then only one node is locked in the cluster, disregarding numOwners config. On the opposite, if this is false, then on all cache.lock() calls numOwners RPCs are being performed. The node that gets locked is the main data owner, i.e. the node where data would reside if numOwners==1. If the node where the lock resides crashes, then the transaction is marked for rollback - data is in a consistent state, no fault tolerance.

Parameters:
eagerLockSingleNode -

cacheStopTimeout

Configuration.TransactionConfig cacheStopTimeout(Integer 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.



Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.