|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.iapi.services.context.ContextImpl
org.apache.derby.jdbc.XATransactionState
final class XATransactionState
Nested Class Summary | |
---|---|
private class |
XATransactionState.CancelXATransactionTask
The implementation of TimerTask to cancel a global transaction. |
Field Summary | |
---|---|
private EmbedXAResource |
associatedResource
|
(package private) int |
associationState
Association state of the transaction. |
(package private) EmbedConnection |
conn
|
(package private) EmbedXAResource |
creatingResource
|
(package private) boolean |
isPrepared
has this transaction been prepared. |
(package private) boolean |
performTimeoutRollback
Indicates whether this transaction is supposed to be rolled back by timeout. |
(package private) int |
rollbackOnlyCode
|
(package private) java.util.HashMap |
suspendedList
When an XAResource suspends a transaction (end(TMSUSPEND)) it must be resumed using the same XAConnection. |
(package private) static int |
T0_NOT_ASSOCIATED
|
(package private) static int |
T1_ASSOCIATED
|
(package private) static int |
TC_COMPLETED
|
(package private) XATransactionState.CancelXATransactionTask |
timeoutTask
A timer task scheduled for the time when the transaction will timeout. |
(package private) static int |
TRO_DEADLOCK
Rollback-only due to deadlock |
(package private) static int |
TRO_FAIL
Rollback-only due to end(TMFAIL) |
(package private) static int |
TRO_TIMEOUT
Rollback-only due to timeout |
(package private) XAXactId |
xid
|
Constructor Summary | |
---|---|
XATransactionState(ContextManager cm,
EmbedConnection conn,
EmbedXAResource resource,
XAXactId xid)
|
Method Summary | |
---|---|
(package private) void |
cancel(java.lang.String messageId)
This function is called from the timer task when the transaction times out. |
void |
cleanupOnError(java.lang.Throwable t)
Contexts will be passed errors that are caught by the outer system when they are serious enough to require corrective action. |
(package private) boolean |
end(EmbedXAResource resource,
int flags,
boolean endingCurrentXid)
|
(package private) void |
scheduleTimeoutTask(long timeoutMillis)
Schedule a timeout task wich will rollback the global transaction after the specified time will elapse. |
(package private) void |
start(EmbedXAResource resource,
int flags)
|
(package private) void |
xa_commit(boolean onePhase)
Commit the global transaction and cancel the timeout task. |
(package private) void |
xa_finalize()
This method cancels timeoutTask and assigns 'performTimeoutRollback = false'. |
(package private) int |
xa_prepare()
Prepare the global transaction for commit. |
(package private) void |
xa_rollback()
Rollback the global transaction and cancel the timeout task. |
Methods inherited from class org.apache.derby.iapi.services.context.ContextImpl |
---|
appendErrorInfo, getContextManager, getIdName, isLastHandler, popMe, pushMe |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final int TRO_TIMEOUT
static final int TRO_DEADLOCK
static final int TRO_FAIL
static final int T0_NOT_ASSOCIATED
static final int T1_ASSOCIATED
static final int TC_COMPLETED
final EmbedConnection conn
final EmbedXAResource creatingResource
private EmbedXAResource associatedResource
final XAXactId xid
java.util.HashMap suspendedList
int associationState
int rollbackOnlyCode
boolean isPrepared
boolean performTimeoutRollback
XATransactionState.CancelXATransactionTask timeoutTask
Constructor Detail |
---|
XATransactionState(ContextManager cm, EmbedConnection conn, EmbedXAResource resource, XAXactId xid)
Method Detail |
---|
public void cleanupOnError(java.lang.Throwable t)
Context
Contexts must release all their resources before removing themselves from their context manager.
The context manager will "unwind" the contexts during cleanup in the reverse order they were placed on its global stack.
If error is an instance of StandardException then an implementation of this method may throw a new exception if and only if the new exception is an instance of StandardException that is more severe than the original error or the new exception is a not an instance of StandardException (e.g java.lang.NullPointerException).
void start(EmbedXAResource resource, int flags) throws javax.transaction.xa.XAException
javax.transaction.xa.XAException
boolean end(EmbedXAResource resource, int flags, boolean endingCurrentXid) throws javax.transaction.xa.XAException
javax.transaction.xa.XAException
void scheduleTimeoutTask(long timeoutMillis)
timeoutMillis
- The number of milliseconds to be elapsed before
the transaction will be rolled back.void xa_rollback() throws java.sql.SQLException
java.sql.SQLException
void xa_commit(boolean onePhase) throws java.sql.SQLException
onePhase
- Indicates whether to use one phase commit protocol.
Otherwise two phase commit protocol will be used.
java.sql.SQLException
int xa_prepare() throws java.sql.SQLException
java.sql.SQLException
void xa_finalize()
void cancel(java.lang.String messageId) throws javax.transaction.xa.XAException
javax.transaction.xa.XAException
XATransactionState.CancelXATransactionTask
|
Built on Thu 2010-12-23 20:49:13+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |