Save This Page
Home » spring-framework-2.5.4 » org.springframework » transaction » jta » [javadoc | source]
org.springframework.transaction.jta
public class: WebSphereUowTransactionManager [javadoc | source]
java.lang.Object
   org.springframework.transaction.support.AbstractPlatformTransactionManager
      org.springframework.transaction.jta.JtaTransactionManager
         org.springframework.transaction.jta.WebSphereUowTransactionManager

All Implemented Interfaces:
    CallbackPreferringPlatformTransactionManager, Serializable, TransactionFactory, InitializingBean, PlatformTransactionManager

WebSphere-specific PlatformTransactionManager implementation that delegates to a com.ibm.wsspi.uow.UOWManager instance, obtained from WebSphere's JNDI environment. This allows Spring to leverage the full power of the WebSphere transaction coordinator, including transaction suspension, in a manner that is perfectly compliant with officially supported WebSphere API.

The CallbackPreferringPlatformTransactionManager interface implemented by this class indicates that callers should preferably pass in a TransactionCallback through the #execute method, which will be handled through the callback-based WebSphere UOWManager API instead of through standard JTA API (UserTransaction / TransactionManager). This avoids the use of the non-public javax.transaction.TransactionManager API on WebSphere, staying within supported WebSphere API boundaries.

This transaction manager implementation derives from Spring's standard JtaTransactionManager , inheriting the capability to support programmatic transaction demarcation via getTransaction / commit / rollback calls through a JTA UserTransaction handle, for callers that do not use the TransactionCallback-based #execute method. However, transaction suspension is not supported in this getTransaction style (unless you explicitly specify a #setTransactionManager reference, despite the official WebSphere recommendations). Use the #execute style for any code that might require transaction suspension.

This transaction manager is compatible with WebSphere 7.0 as well as recent WebSphere 6.0.x and 6.1.x versions. Check the documentation for your specific WebSphere version to find out whether UOWManager support is available. If it is not available, consider using Spring's standard JtaTransactionManager class, if necessary specifying the WebSphereTransactionManagerFactoryBean as "transactionManager" through the corresponding bean property. However, note that transaction suspension is not officially supported in such a scenario (despite it being known to work properly).

The default JNDI location for the UOWManager is "java:comp/websphere/UOWManager". If the location happens to differ according to your WebSphere documentation, simply specify the actual location through this transaction manager's "uowManagerName" bean property.

Field Summary
public static final  String DEFAULT_UOW_MANAGER_NAME    Default JNDI location for the WebSphere UOWManager. 
Fields inherited from org.springframework.transaction.jta.JtaTransactionManager:
DEFAULT_USER_TRANSACTION_NAME,  FALLBACK_TRANSACTION_MANAGER_NAMES,  DEFAULT_TRANSACTION_SYNCHRONIZATION_REGISTRY_NAME
Fields inherited from org.springframework.transaction.support.AbstractPlatformTransactionManager:
SYNCHRONIZATION_ALWAYS,  SYNCHRONIZATION_ON_ACTUAL_TRANSACTION,  SYNCHRONIZATION_NEVER,  logger
Constructor:
 public WebSphereUowTransactionManager() 
 public WebSphereUowTransactionManager(UOWManager uowManager) 
    Create a new WebSphereUowTransactionManager for the given UOWManager.
    Parameters:
    uowManager - the WebSphere UOWManager to use as direct reference
Method from org.springframework.transaction.jta.WebSphereUowTransactionManager Summary:
afterPropertiesSet,   doRegisterAfterCompletionWithJtaTransaction,   execute,   lookupUowManager,   setUowManager,   setUowManagerName
Methods from org.springframework.transaction.jta.JtaTransactionManager:
afterPropertiesSet,   applyIsolationLevel,   applyTimeout,   buildUserTransaction,   checkUserTransactionAndTransactionManager,   createTransaction,   doBegin,   doCommit,   doGetJtaTransaction,   doGetTransaction,   doJtaBegin,   doJtaResume,   doJtaSuspend,   doRegisterAfterCompletionWithJtaTransaction,   doResume,   doRollback,   doSetRollbackOnly,   doSuspend,   findTransactionManager,   findTransactionSynchronizationRegistry,   findUserTransaction,   getJndiEnvironment,   getJndiTemplate,   getTransactionManager,   getUserTransaction,   initTransactionSynchronizationRegistry,   initUserTransactionAndTransactionManager,   isExistingTransaction,   lookupTransactionManager,   lookupTransactionSynchronizationRegistry,   lookupUserTransaction,   registerAfterCompletionWithExistingTransaction,   retrieveTransactionManager,   retrieveTransactionSynchronizationRegistry,   retrieveUserTransaction,   setAllowCustomIsolationLevels,   setAutodetectTransactionManager,   setAutodetectUserTransaction,   setCacheUserTransaction,   setJndiEnvironment,   setJndiTemplate,   setTransactionManager,   setTransactionManagerName,   setTransactionSynchronizationRegistryName,   setUserTransaction,   setUserTransactionName,   shouldCommitOnGlobalRollbackOnly,   useSavepointForNestedTransaction
Methods from org.springframework.transaction.support.AbstractPlatformTransactionManager:
commit,   determineTimeout,   doBegin,   doCleanupAfterCompletion,   doCommit,   doGetTransaction,   doResume,   doRollback,   doSetRollbackOnly,   doSuspend,   getDefaultTimeout,   getTransaction,   getTransactionSynchronization,   invokeAfterCompletion,   isExistingTransaction,   isFailEarlyOnGlobalRollbackOnly,   isGlobalRollbackOnParticipationFailure,   isNestedTransactionAllowed,   isRollbackOnCommitFailure,   isValidateExistingTransaction,   newTransactionStatus,   prepareForCommit,   registerAfterCompletionWithExistingTransaction,   resume,   rollback,   setDefaultTimeout,   setFailEarlyOnGlobalRollbackOnly,   setGlobalRollbackOnParticipationFailure,   setNestedTransactionAllowed,   setRollbackOnCommitFailure,   setTransactionSynchronization,   setTransactionSynchronizationName,   setValidateExistingTransaction,   shouldCommitOnGlobalRollbackOnly,   suspend,   triggerBeforeCommit,   triggerBeforeCompletion,   useSavepointForNestedTransaction
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.transaction.jta.WebSphereUowTransactionManager Detail:
 public  void afterPropertiesSet() throws TransactionSystemException 
 protected  void doRegisterAfterCompletionWithJtaTransaction(JtaTransactionObject txObject,
    List synchronizations) 
    Registers the synchronizations as interposed JTA Synchronization on the UOWManager.
 public Object execute(TransactionDefinition definition,
    TransactionCallback callback) throws TransactionException 
 protected UOWManager lookupUowManager(String uowManagerName) throws TransactionSystemException 
    Look up the WebSphere UOWManager in JNDI via the configured name. Called by afterPropertiesSet if no direct UOWManager reference was set. Can be overridden in subclasses to provide a different UOWManager object.
 public  void setUowManager(UOWManager uowManager) 
    Set the WebSphere UOWManager to use as direct reference.

    Typically just used for test setups; in a J2EE environment, the UOWManager will always be fetched from JNDI.

 public  void setUowManagerName(String uowManagerName) 
    Set the JNDI name of the WebSphere UOWManager. The default "java:comp/websphere/UOWManager" is used if not set.