|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.lateralnz.simpletrans.SimpleTransactionManager
public class SimpleTransactionManager
a singleton implementation of a transaction manager, using thread-local variables to store the current transaction.
| Constructor Summary | |
|---|---|
SimpleTransactionManager()
|
|
| Method Summary | |
|---|---|
void |
begin()
begin a transaction. |
void |
commit()
commit the current transaction (note: this doesn't throw an error if the current thread is not in a transaction) |
javax.naming.Reference |
getReference()
|
int |
getStatus()
get the status of the current transaction |
javax.transaction.Transaction |
getTransaction()
get the transaction for the current (calling) thread |
static SimpleTransactionManager |
getTransactionManager()
|
protected boolean |
isInTransaction()
a helper function to indicate if the calling thread is in a transaction |
void |
resume(javax.transaction.Transaction transaction)
not supported |
void |
rollback()
rollback the current transaction (note: this doesn't throw an error if the current thread is not in a transaction) |
void |
setRollbackOnly()
flag the current transaction for rollback (note: this doesn't throw an error if the current thread is not in a transaction) |
void |
setTransactionTimeout(int param)
not supported |
javax.transaction.Transaction |
suspend()
not supported |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleTransactionManager()
| Method Detail |
|---|
public static final SimpleTransactionManager getTransactionManager()
public javax.naming.Reference getReference()
getReference in interface javax.naming.Referenceablepublic void begin()
begin in interface javax.transaction.TransactionManagerbegin in interface javax.transaction.UserTransaction
public void commit()
throws javax.transaction.RollbackException,
javax.transaction.HeuristicMixedException,
javax.transaction.HeuristicRollbackException,
javax.transaction.SystemException
commit in interface javax.transaction.TransactionManagercommit in interface javax.transaction.UserTransactionjavax.transaction.RollbackException
javax.transaction.HeuristicMixedException
javax.transaction.HeuristicRollbackException
javax.transaction.SystemException
public int getStatus()
throws javax.transaction.SystemException
getStatus in interface javax.transaction.TransactionManagergetStatus in interface javax.transaction.UserTransactionjavax.transaction.SystemExceptionpublic javax.transaction.Transaction getTransaction()
getTransaction in interface javax.transaction.TransactionManagerpublic void resume(javax.transaction.Transaction transaction)
resume in interface javax.transaction.TransactionManager
public void rollback()
throws javax.transaction.SystemException
rollback in interface javax.transaction.TransactionManagerrollback in interface javax.transaction.UserTransactionjavax.transaction.SystemException
public void setRollbackOnly()
throws javax.transaction.SystemException
setRollbackOnly in interface javax.transaction.TransactionManagersetRollbackOnly in interface javax.transaction.UserTransactionjavax.transaction.SystemExceptionpublic void setTransactionTimeout(int param)
setTransactionTimeout in interface javax.transaction.TransactionManagersetTransactionTimeout in interface javax.transaction.UserTransactionpublic javax.transaction.Transaction suspend()
suspend in interface javax.transaction.TransactionManagerprotected boolean isInTransaction()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||