|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jts.jta.TransactionManagerImpl
public class TransactionManagerImpl
An implementation of javax.transaction.TransactionManager using JTA. This is a singleton object
| Method Summary | |
|---|---|
void |
begin()
Create a new transaction and associate it with the current thread. |
void |
begin(int timeout)
Create a new transaction with the given timeout 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. |
Transaction |
getTransaction()
Get the transaction object that represents the transaction context of the calling thread |
static TransactionManagerImpl |
getTransactionManagerImpl()
get the singleton TransactionManagerImpl |
static int |
getXAResourceTimeOut()
|
static XATerminator |
getXATerminator()
Provides a handle to a XATerminator instance. |
static void |
initJTSProperties(java.util.Properties props,
java.lang.String logDir,
boolean trace,
java.lang.String traceDir)
extends props with the JTS-related properties based on the specified parameters. |
static int |
mapStatus(org.omg.CosTransactions.Status status)
given a CosTransactions Status, return the equivalent JTA Status |
static void |
recover(java.util.Enumeration xaResourceList)
The application server passes in the list of XAResource objects to be recovered. |
static void |
recreate(Xid xid,
long timeout)
Recreate a transaction based on the Xid. |
static void |
release(Xid xid)
Release a transaction. |
void |
resume(Transaction suspended)
Resume the transaction context association of the calling thread with the transaction represented by the supplied Transaction object. |
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 timeout value that is associated with transactions started by subsequent invocations of the begin method. |
static void |
setXAResourceTimeOut(int value)
used to set XAResource timeout |
Transaction |
suspend()
Suspend the transaction currently associated with the calling thread and return a Transaction object that represents the transaction context being suspended. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static TransactionManagerImpl getTransactionManagerImpl()
public static void initJTSProperties(java.util.Properties props,
java.lang.String logDir,
boolean trace,
java.lang.String traceDir)
prop - the properties that will be extendedlogDir - directory for the log, current directory if nulltrace - enable JTS tracingtraceDir - directory for tracing, current directory if nullpublic static int mapStatus(org.omg.CosTransactions.Status status)
public void begin()
throws NotSupportedException,
SystemException
begin in interface TransactionManagerNotSupportedException - Thrown if the thread is already
associated with a transaction.
SystemException
public void begin(int timeout)
throws NotSupportedException,
SystemException
NotSupportedException - Thrown if the thread is already
associated with a transaction.
SystemException
public void commit()
throws RollbackException,
HeuristicMixedException,
HeuristicRollbackException,
java.lang.SecurityException,
java.lang.IllegalStateException,
SystemException
commit in interface TransactionManagerRollbackException - Thrown to indicate that
the transaction has been rolled back rather than committed.
HeuristicMixedException - Thrown to indicate that a heuristic
decision was made and that some relevant updates have been committed
while others have been rolled back.
HeuristicRollbackException - Thrown to indicate that a
heuristic decision was made and that all relevant updates have been
rolled back.
java.lang.SecurityException - Thrown to indicate that the thread is
not allowed to commit the transaction.
java.lang.IllegalStateException - Thrown if the current thread is
not associated with a transaction.
SystemException
public void rollback()
throws java.lang.IllegalStateException,
java.lang.SecurityException,
SystemException
rollback in interface TransactionManagerjava.lang.SecurityException - Thrown to indicate that the thread is
not allowed to roll back the transaction.
java.lang.IllegalStateException - Thrown if the current thread is
not associated with a transaction.
SystemException
public void setRollbackOnly()
throws java.lang.IllegalStateException,
SystemException
setRollbackOnly in interface TransactionManagerjava.lang.IllegalStateException - Thrown if the current thread is
not associated with a transaction.
SystemException
public int getStatus()
throws SystemException
getStatus in interface TransactionManagerSystemException
public void setTransactionTimeout(int seconds)
throws SystemException
If an application has not called this method, the transaction service uses some default value for the transaction timeout.
setTransactionTimeout in interface TransactionManagerseconds - The value of the timeout in seconds. If the value is zero,
the transaction service restores the default value. If the value
is negative a SystemException is thrown.
SystemException - Thrown if the transaction manager
encounters an unexpected error condition.
public Transaction getTransaction()
throws SystemException
getTransaction in interface TransactionManagerSystemException
public void resume(Transaction suspended)
throws InvalidTransactionException,
java.lang.IllegalStateException,
SystemException
resume in interface TransactionManagerInvalidTransactionException
java.lang.IllegalStateException
SystemException
public Transaction suspend()
throws SystemException
suspend in interface TransactionManagerSystemExceptionpublic static void recover(java.util.Enumeration xaResourceList)
xaResourceList - list of XAResource objects.
public static void recreate(Xid xid,
long timeout)
throws WorkException
xid - the Xid object representing a transaction.timeout - positive, non-zero value for transaction timeout.
WorkException
public static void release(Xid xid)
throws WorkException
xid - the Xid object representing a transaction.
WorkExceptionpublic static XATerminator getXATerminator()
XATerminator instance. The
XATerminator instance could be used by a resource adapter
to flow-in transaction completion and crash recovery calls from an EIS.
XATerminator instance.public static void setXAResourceTimeOut(int value)
public static int getXAResourceTimeOut()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||