com.ibm.jbatch.container.transaction.impl
Class JTAUserTransactionAdapter

java.lang.Object
  extended by com.ibm.jbatch.container.transaction.impl.JTAUserTransactionAdapter
All Implemented Interfaces:
TransactionManagerAdapter

public class JTAUserTransactionAdapter
extends Object
implements TransactionManagerAdapter

The JTA Transaction Adapter is used in a J2EE environment where a JTA tran manager is available. *


Field Summary
protected  UserTransaction userTran
          JTA transaction manager
 
Constructor Summary
JTAUserTransactionAdapter(String jndiLookup)
          constructor
 
Method Summary
 void begin()
          Create a new transaction and associate it with the current thread.
 void commit()
          Complete the transaction associated with the current thread.
 int getStatus()
          Obtain the status of the transaction associated with the current thread.
 void rollback()
          Roll back the transaction associated with the current thread.
 void setRollbackOnly()
          Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
 void setTransactionTimeout(int seconds)
          Modify the value of the timeout value that is associated with the transactions started by the current thread with the begin method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

userTran

protected UserTransaction userTran
JTA transaction manager

Constructor Detail

JTAUserTransactionAdapter

public JTAUserTransactionAdapter(String jndiLookup)
constructor

Method Detail

begin

public void begin()
           throws TransactionManagementException
Description copied from interface: TransactionManagerAdapter
Create a new transaction and associate it with the current thread.

Specified by:
begin in interface TransactionManagerAdapter
Throws:
TransactionManagementException

commit

public void commit()
            throws TransactionManagementException
Description copied from interface: TransactionManagerAdapter
Complete the transaction associated with the current thread.

Specified by:
commit in interface TransactionManagerAdapter
Throws:
TransactionManagementException

rollback

public void rollback()
              throws TransactionManagementException
Description copied from interface: TransactionManagerAdapter
Roll back the transaction associated with the current thread. When this method completes, the thread becomes associated with no transaction.

Specified by:
rollback in interface TransactionManagerAdapter
Throws:
TransactionManagementException

getStatus

public int getStatus()
              throws TransactionManagementException
Description copied from interface: TransactionManagerAdapter
Obtain the status of the transaction associated with the current thread.

Specified by:
getStatus in interface TransactionManagerAdapter
Returns:
The transaction status.
Throws:
TransactionManagementException

setRollbackOnly

public void setRollbackOnly()
                     throws TransactionManagementException
Description copied from interface: TransactionManagerAdapter
Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.

Specified by:
setRollbackOnly in interface TransactionManagerAdapter
Throws:
TransactionManagementException

setTransactionTimeout

public void setTransactionTimeout(int seconds)
                           throws TransactionManagementException
Description copied from interface: TransactionManagerAdapter
Modify the value of the timeout value that is associated with the transactions started by the current thread with the begin method.

Specified by:
setTransactionTimeout in interface TransactionManagerAdapter
Parameters:
seconds - seconds - The value of the timeout in seconds. If the value is zero, the transaction service restores the default value.
Throws:
TransactionManagementException


Copyright © 2013. All Rights Reserved.