com.atomikos.datasource
Interface ResourceTransaction

All Known Implementing Classes:
XAResourceTransaction

public interface ResourceTransaction

The notion of a local transaction executed on a resource. Serves as a handle towards the transaction management module.


Method Summary
 void addCompensationContext(Dictionary context)
          Add a compensation context for this resourcetx.
 void addHeuristicMessage(HeuristicMessage mesg)
          Add heuristic resolution information.
 Dictionary getCompensationContext()
          Get the compensation information.
 HeuristicMessage[] getHeuristicMessages()
          Get heuristic context info.
 String getTid()
          Get identifier for this tx.
 void resume()
          Resume a suspended tx.
 void suspend()
          Suspend the resourcetransaction, so that underlying resources can be used for a next (sibling) invocation.
 

Method Detail

getTid

String getTid()
Get identifier for this tx. Should be unique in system.

Returns:
String The identifier, as determined by resource.

addCompensationContext

void addCompensationContext(Dictionary context)
                            throws IllegalStateException
Add a compensation context for this resourcetx.

Parameters:
context - The compensation context.
Throws:
IllegalStateException - If no longer active.

addHeuristicMessage

void addHeuristicMessage(HeuristicMessage mesg)
                         throws IllegalStateException
Add heuristic resolution information.

Parameters:
mesg - The heuristic message.
Throws:
IllegalStateException - If no longer active.

getHeuristicMessages

HeuristicMessage[] getHeuristicMessages()
Get heuristic context info.

Returns:
HeuristicMessage[] An array of messages, or null if none.

getCompensationContext

Dictionary getCompensationContext()
Get the compensation information.

Returns:
java.util.Dictionary The compensation info, or null if none.

suspend

void suspend()
             throws IllegalStateException,
                    ResourceException
Suspend the resourcetransaction, so that underlying resources can be used for a next (sibling) invocation. This is also the recommended method for adding the resourcetx to the coordinator object, but ONLY if the transaction has not been set for rollback. NOTE: suspend is NOT the same as XAResource's suspension! The XAResource version is specific to the XA protocol, and does not belong in the composite system framework. As mentioned in the JTA specs., the APPLICATION SERVER is responsible for XAsuspension and XAresume ( page 11 of JTA API, version of May 12, 1999 ).

Throws:
IllegalStateException - If wrong state.
ResourceException

resume

void resume()
            throws IllegalStateException,
                   ResourceException
Resume a suspended tx.

Throws:
IllegalStateException - If not right state.
ResourceException


Copyright © 2011. All Rights Reserved.