|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface TransactionContext
The TransactionContext provides methods, that allows the Transaction Resources to join and participate in the current transaction. It also prevents them from performing full commit or rollback.
| Field Summary | |
|---|---|
static int |
STATUS_ACTIVE
Directly after it is created the status is ACTIVE. |
static int |
STATUS_COMMITTED
After the transaction is ended and has ended successfully. |
static int |
STATUS_COMMITTING
During the second phase |
static int |
STATUS_MARKED_ROLLBACK
Any participant of the transaction can mark the transaction setRollbackOnly. |
static int |
STATUS_NO_TRANSACTION
No transaction is currently associated with the target object. |
static int |
STATUS_PREPARED
After the first phase of 2-phase commit, just before STATUS_COMMITTING |
static int |
STATUS_PREPARING
During the first phase of the 2-phase commit. |
static int |
STATUS_ROLLEDBACK
After the transaction is rolled back. |
static int |
STATUS_ROLLING_BACK
During the roll back phase. |
static int |
STATUS_UNKNOWN
A transaction is associated with the target object but its current status cannot be determined. |
| Method Summary | |
|---|---|
boolean |
associateThread(java.lang.Thread thread)
This method allows a resource to associate the current transaction to another thread. |
boolean |
disassociateThread()
This method disassociates the current thread from the transaction. |
long |
getPid()
This method is used to query the PID of the transaction. |
int |
getStatus()
Obtain the status of the transaction associated with the current thread. |
boolean |
join(TransactionResource tr)
A resource manager that wants to participate in the transaction should register with this transaction through this method. |
void |
resetTimeout()
This method will reset the timeout. |
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. |
boolean |
waitThreadsToFinish(int timeout)
This method waits all threads except one to disassociate from the transaction. |
| Field Detail |
|---|
static final int STATUS_UNKNOWN
static final int STATUS_ACTIVE
static final int STATUS_COMMITTING
static final int STATUS_COMMITTED
static final int STATUS_MARKED_ROLLBACK
static final int STATUS_NO_TRANSACTION
static final int STATUS_PREPARED
static final int STATUS_PREPARING
static final int STATUS_ROLLEDBACK
static final int STATUS_ROLLING_BACK
| Method Detail |
|---|
int getStatus()
void setRollbackOnly()
boolean join(TransactionResource tr)
tr - The associated transaction resource manager
void resetTimeout()
long getPid()
boolean associateThread(java.lang.Thread thread)
throws TransactionException
thread - the thread, to which the transaction should be associated.
true if association is succesfull or
false if the target thread, already has an
associated transaction.
TransactionException - If the transaction is not in the active stateboolean disassociateThread()
true if the thread was associated to the
transaction, false - if not.boolean waitThreadsToFinish(int timeout)
timeout - the timeout within the threads must disassociate in milliseconds.
true if the threads disassociated within the given
timeout, false - if not.
|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||