|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Defines the context of global or local session transaction that is associated per thread with an application.
| Field Summary | |
static java.lang.String |
STANDARD_RESOURCE
A publicly known constant for a name denotes a "standard" transactional resource . |
| Method Summary | |
void |
closeAllResources()
Closes all the resources associated the transaction explicitly. |
void |
commit()
Completes the transaction and associated it with the current thread. |
void |
delistResource(java.lang.String name,
IResourceController resource)
Disassociate the supplied transactional resource with the transaction context |
void |
enlistResource(java.lang.String name,
IResourceController resource)
Associate the supplied transactional resource with the transaction context |
java.lang.Object |
getAttribute(java.lang.String key)
|
java.util.Iterator |
getAttributeNames()
|
java.lang.Object |
getResource(java.lang.String name)
Retrieve the named transactional resource that is associated with this current transaction. |
TransactionStateEnum |
getTransactionState()
Retrieves the current state of the transaction |
boolean |
isRollbackOnly()
Gets the boolean flag if transaction is primed to roll back, or has rolled back already. |
boolean |
isTransactionNew()
Gets the boolean flag if transaction associated with this thread is a brand new creation. |
void |
rollback()
Roll back the transaction associated with the current thread. |
void |
setAttribute(java.lang.String key,
java.lang.Object value)
|
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. |
| Field Detail |
public static final java.lang.String STANDARD_RESOURCE
| Method Detail |
public java.lang.Object getResource(java.lang.String name)
throws TransactionException
A transactional resource, for example, may be a database connection and the name of this resource may could be JNDI lookup name. This approach would be very similar to way the data sources and associated connections are retrieved in a EJB / JTA connection
name - the name of the transactional resource
TransactionException - if the operation cannot be completedenlistResource(String, IResourceController),
delistResource(String, IResourceController)
public void commit()
throws TransactionException
TransactionException - if the commit operation cannot be completedrollback(),
ITransactionServiceManager#commit(ITransactionSession, ITransactionConfig),
ITransactionServiceManager.begin(ITransactionSession, ITransactionConfig)
public void rollback()
throws TransactionException
TransactionException - if the rollback operation cannot be completedcommit(),
ITransactionServiceManager.rollback(),
ITransactionServiceManager.begin(ITransactionSession, ITransactionConfig)
public void setRollbackOnly()
throws TransactionException
TransactionException - if the set rollback operation cannot be completedisRollbackOnly()
public void setTransactionTimeout(int seconds)
throws TransactionException
seconds -
TransactionException - if the operation cannot be completedpublic boolean isRollbackOnly()
rollback()public boolean isTransactionNew()
true if the current transaction is new.ITransactionServiceManager.isTransactionNew(ITransactionContext)public TransactionStateEnum getTransactionState()
public void enlistResource(java.lang.String name,
IResourceController resource)
name - the name of the transactional resourceresource - the resource controller to associate with the transaction
TransactionException - if the enlistment operation cannot be completeddelistResource(String, IResourceController)
public void delistResource(java.lang.String name,
IResourceController resource)
name - the name of the transactional resourceresource - the resource controller to disassociate from the transaction
TransactionException - if the delistment operation cannot be completedenlistResource(String, IResourceController)
public void closeAllResources()
throws TransactionException
The implementations of the transaction context may behave differently. For example JTA implementation typically does not close JNDI connections.
TransactionExceptionpublic java.util.Iterator getAttributeNames()
public java.lang.Object getAttribute(java.lang.String key)
public void setAttribute(java.lang.String key,
java.lang.Object value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||