com.atomikos.icatch.admin
Interface AdminTransaction


public interface AdminTransaction

An administration interface for a transaction. Allows inspection of heuristic info, as well as forced two-phase commit methods.


Method Summary
 void forceCommit()
          Forces commit of the transaction.
 void forceForget()
          Forces the system to forget about the transaction.
 void forceRollback()
          Forces rollback of the transaction.
 java.lang.String[] getParticipantDetails()
          Retrieves the descriptive details for each participant involved in this transaction.
 TxState getState()
          Gets the transaction's state.
 java.lang.String getTid()
          Gets the transaction identifier.
 boolean hasExpired()
           
 boolean wasCommitted()
          Tests if the transaction's 2PC outcome was commit.
 

Method Detail

getTid

java.lang.String getTid()
Gets the transaction identifier.

Returns:
String The unique id.

getState

TxState getState()
Gets the transaction's state.

Returns:
int The state, one of the predefined states. NOTE: the state is an int rather than the generic Object, because instances need to be Serializable.

wasCommitted

boolean wasCommitted()
Tests if the transaction's 2PC outcome was commit. Needed especially for the heuristic states, if the desired outcome (instead of the actual state) needs to be retrieved. For instance, if the state is STATE_HEUR_HAZARD then extra information is needed for determining if the desired outcome was commit or rollback. This method helps here.

Returns:
True if commit was decided (either heuristically or by the super coordinator).

forceCommit

void forceCommit()
                 throws HeurRollbackException,
                        HeurHazardException,
                        HeurMixedException,
                        SysException
Forces commit of the transaction.

Throws:
HeurRollbackException - If rolled back in the meantime.
HeurMixedException - If part of it was rolled back.
HeurHazardException - On possible conflicts.
SysException

forceRollback

void forceRollback()
                   throws HeurCommitException,
                          HeurMixedException,
                          HeurHazardException,
                          SysException
Forces rollback of the transaction.

Throws:
HeurCommitException - If heuristically committed in the meantime.
HeurHazardException - If the state is not certain.
HeurMixedException - If partially rolled back.
SysException

forceForget

void forceForget()
Forces the system to forget about the transaction.


getParticipantDetails

java.lang.String[] getParticipantDetails()
Retrieves the descriptive details for each participant involved in this transaction.


hasExpired

boolean hasExpired()
Returns:
True if this transaction has expired past its timeout.


Copyright © 2016. All Rights Reserved.