org.apache.derby.jdbc
Class XATransactionState

java.lang.Object
  extended byorg.apache.derby.iapi.services.context.ContextImpl
      extended byorg.apache.derby.jdbc.XATransactionState
All Implemented Interfaces:
Context

public final class XATransactionState
extends ContextImpl


Field Summary
private  EmbedXAConnection associatedResource
           
(package private)  int associationState
          Association state of the transaction.
 EmbedConnection20 conn
           
(package private)  EmbedXAConnection creatingResource
           
(package private)  boolean isPrepared
          has this transaction been prepared.
(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) static int TRO_DEADLOCK
          Rollback-only due to deadlock
(package private) static int TRO_FAIL
          Rollback-only due to end(TMFAIL)
(package private)  XAXactId xid
           
 
Fields inherited from class org.apache.derby.iapi.services.context.ContextImpl
 
Constructor Summary
(package private) XATransactionState(ContextManager cm, EmbedConnection20 conn, EmbedXAConnection resource, XAXactId xid)
           
 
Method Summary
 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(EmbedXAConnection resource, int flags, boolean endingCurrentXid)
           
(package private)  void start(EmbedXAConnection resource, int flags)
           
 
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

TRO_DEADLOCK

static final int TRO_DEADLOCK
Rollback-only due to deadlock

See Also:
Constant Field Values

TRO_FAIL

static final int TRO_FAIL
Rollback-only due to end(TMFAIL)

See Also:
Constant Field Values

T0_NOT_ASSOCIATED

static final int T0_NOT_ASSOCIATED
See Also:
Constant Field Values

T1_ASSOCIATED

static final int T1_ASSOCIATED
See Also:
Constant Field Values

TC_COMPLETED

static final int TC_COMPLETED
See Also:
Constant Field Values

conn

public final EmbedConnection20 conn

creatingResource

final EmbedXAConnection creatingResource

associatedResource

private EmbedXAConnection associatedResource

xid

final XAXactId xid

suspendedList

java.util.HashMap suspendedList
When an XAResource suspends a transaction (end(TMSUSPEND)) it must be resumed using the same XAConnection. This has been the traditional Cloudscape behaviour, though there does not seem to be a specific reference to this behaviour in the JTA spec. Note that while the transaction is suspended by this XAResource, another XAResource may join the transaction and suspend it after the join.


associationState

int associationState
Association state of the transaction.


rollbackOnlyCode

int rollbackOnlyCode

isPrepared

boolean isPrepared
has this transaction been prepared.

Constructor Detail

XATransactionState

XATransactionState(ContextManager cm,
                   EmbedConnection20 conn,
                   EmbedXAConnection resource,
                   XAXactId xid)
Method Detail

cleanupOnError

public void cleanupOnError(java.lang.Throwable t)
Description copied from interface: Context
Contexts will be passed errors that are caught by the outer system when they are serious enough to require corrective action. They will be told what the error is, so that they can react appropriately. Most of the time, the contexts will react by either doing nothing or by removing themselves from the context manager. If there are no other references to the context, removing itself from the manager equates to freeing it.

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).


start

void start(EmbedXAConnection resource,
           int flags)
     throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException

end

boolean end(EmbedXAConnection resource,
            int flags,
            boolean endingCurrentXid)
      throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException


Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.