public class TuxTransactionManager
extends java.lang.Object
implements javax.transaction.TransactionManager, javax.transaction.UserTransaction, javax.naming.Referenceable
Modifier and Type | Method and Description |
---|---|
void |
begin()
Create a new transaction and associate it with the current thread.
|
void |
commit()
Complete the transaction associated with the current thread.
|
com.oracle.tuxedo.tjatmi.TuxTransaction |
getCurrentTransaction()
Get the transaction currently associated with the current thread context.
|
int |
getDefaultTransactionTimeout()
Get the default transaction timeout value asscociated with current
transaction manager.
|
javax.naming.Reference |
getReference()
Retrieves the Reference of this object.
|
int |
getStatus()
Obtain the status of the transaction associated with the current thread.
|
javax.transaction.Transaction |
getTransaction()
Get the transaction object that represents the transaction context of
the calling thread.
|
static javax.transaction.TransactionManager |
getTransactionManager() |
static javax.transaction.UserTransaction |
getUserTransaction() |
void |
resume(javax.transaction.Transaction tobj)
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.
|
javax.transaction.Transaction |
suspend()
Suspend the transaction currently associated with the calling thread and
return a Transaction object that represents the transaction context being
suspended.
|
java.lang.String |
toString() |
public void begin() throws javax.transaction.NotSupportedException, javax.transaction.SystemException
begin
in interface javax.transaction.TransactionManager
begin
in interface javax.transaction.UserTransaction
javax.transaction.NotSupportedException
- -
Thrown if the thread is already associated with a transaction
and the Transaction Manager implementation does not support
nested transactions.javax.transaction.SystemException
- -
Thrown if the transaction manager encounters an unexpected
error condition.TransactionManager.begin()
public void commit() throws javax.transaction.RollbackException, javax.transaction.HeuristicRollbackException, javax.transaction.HeuristicMixedException, java.lang.SecurityException, java.lang.IllegalStateException, javax.transaction.SystemException
commit
in interface javax.transaction.TransactionManager
commit
in interface javax.transaction.UserTransaction
javax.transaction.RollbackException
- -
Thrown to indicate that the transaction has been rolled back
rather than committed.javax.transaction.HeuristicMixedException
- -
Thrown to indicate that a heuristic decision was made and
that some relevant updates have been committed while others
have been rolled back.javax.transaction.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.javax.transaction.SystemException
- -
Thrown if the transaction manager encounters an unexpected
error condition.TransactionManager.commit()
public void rollback() throws java.lang.IllegalStateException, java.lang.SecurityException, javax.transaction.SystemException
rollback
in interface javax.transaction.TransactionManager
rollback
in interface javax.transaction.UserTransaction
java.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.javax.transaction.SystemException
- -
Thrown if the transaction manager encounters an unexpected
error condition.TransactionManager.rollback()
public javax.transaction.Transaction suspend() throws javax.transaction.SystemException
suspend
in interface javax.transaction.TransactionManager
javax.transaction.SystemException
- -
Thrown if the transaction manager encounters an unexpected
error condition.TransactionManager.suspend()
public void resume(javax.transaction.Transaction tobj) throws javax.transaction.InvalidTransactionException, java.lang.IllegalStateException, javax.transaction.SystemException
resume
in interface javax.transaction.TransactionManager
tobj
- The Transaction object that represents the transaction to
be resumed.javax.transaction.InvalidTransactionException
- -
Thrown if the parameter transaction object contains an
invalid transaction.java.lang.IllegalStateException
- -
Thrown if the thread is already associated with another
transaction.javax.transaction.SystemException
- -
Thrown if the transaction manager encounters an unexpected
error condition.TransactionManager.resume(javax.transaction.Transaction)
public void setRollbackOnly() throws java.lang.IllegalStateException, javax.transaction.SystemException
setRollbackOnly
in interface javax.transaction.TransactionManager
setRollbackOnly
in interface javax.transaction.UserTransaction
java.lang.IllegalStateException
- -
Thrown if the current thread is not associated with a
transaction.javax.transaction.SystemException
- -
Thrown if the transaction manager encounters an unexpected
error condition.TransactionManager.setRollbackOnly()
public void setTransactionTimeout(int seconds) throws javax.transaction.SystemException
setTransactionTimeout
in interface javax.transaction.TransactionManager
setTransactionTimeout
in interface javax.transaction.UserTransaction
seconds
- -
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.javax.transaction.SystemException
- -
Thrown if the transaction manager encounters an unexpected
error condition.TransactionManager.setTransactionTimeout(int)
public int getStatus() throws javax.transaction.SystemException
getStatus
in interface javax.transaction.TransactionManager
getStatus
in interface javax.transaction.UserTransaction
javax.transaction.SystemException
- -
Thrown if the transaction manager encounters an unexpected
error condition.TransactionManager.getStatus()
public javax.transaction.Transaction getTransaction() throws javax.transaction.SystemException
getTransaction
in interface javax.transaction.TransactionManager
javax.transaction.SystemException
- -
Thrown if the transaction manager encounters an unexpected
error condition.TransactionManager.getTransaction()
public static javax.transaction.TransactionManager getTransactionManager()
public static javax.transaction.UserTransaction getUserTransaction()
public com.oracle.tuxedo.tjatmi.TuxTransaction getCurrentTransaction()
public int getDefaultTransactionTimeout()
public java.lang.String toString()
toString
in class java.lang.Object
public javax.naming.Reference getReference() throws javax.naming.NamingException
getReference
in interface javax.naming.Referenceable
javax.naming.NamingException
- If a naming exception was encountered
while retrieving the reference.