IT_Bus::TransactionSystem Class Reference

#include <it_bus/transaction_system.h>

Inheritance diagram for IT_Bus::TransactionSystem:

IT_Bus::RefCountedBase List of all members.

Detailed Description

The interface used to control Transaction demarcation in Artix.

A Transaction is associated with a calling thread when the IT_Bus::TransactionSystem::begin_transaction() or IT_Bus::TransactionManager::attach_thread() operations are called. Subsequent transactional operation calls affect the transaction associated with the calling thread.

Definition at line 27 of file transaction_system.h.

Public Member Functions

virtual void begin_transaction ()=0 throw ((Exception))
 Marks the beginning of a transactional unit of work.
virtual Boolean commit_transaction (Boolean report_heuristics)=0 throw ((Exception))
 Marks the successful end of a transactional unit of work.
virtual void rollback_transaction ()=0 throw ((Exception))
 Marks the unsuccessful end of a transaction unit of work.
virtual TransactionManagerget_transaction_manager (const String &tx_manager_type=DEFAULT_TRANSACTION_TYPE)=0 throw ((Exception))
 Return an interface that allows more detailed interaction with the transaction associated with the calling thread.
virtual Boolean within_transaction ()=0
 Determine if a transaction is currently associated with the calling thread.
virtual TransactionParticipantget_interposition_participant ()=0
 INTERNAL: This operation should not be called from user code.

Static Public Attributes

static const String DEFAULT_TRANSACTION_TYPE
 String constants for the set of supported transaction manager types.
static const String WSAT_TRANSACTION_TYPE
static const String OTS_TRANSACTION_TYPE
static const String XA_TRANSACTION_TYPE


Member Function Documentation

virtual void IT_Bus::TransactionSystem::begin_transaction (  )  throw ((Exception)) [pure virtual]

Marks the beginning of a transactional unit of work.

Where appropriate, all subsequent operation calls made by this thread will contain a propagated Transaction context. If an operation call goes outside of this Bus, for example to a remote webservice, then the transaction context will be propagated remotely to that web service.

Each thread may have a separate transaction associated with it. Multiple threads may be associated with the same transaction. See IT_Bus::TransactionManager::attach_thread() for more details of thread/transaction affinity.

Code that wishes to interact with this transaction for non-demarcation related activities should use the TransactionManager interface returned by calling get_transaction_manager() on the TransactionSystem interface.

Exceptions:
TransactionAlreadyActiveException This exception will be thrown when the transaction system is still active (not commited or rollbacked). for example, this method is called twice consecutively without commit or rollback.
TransactionSystemUnavailableException This exception will be thrown when the transaction system configured in the Artix config file cannot be loaded/initialized.
IT_Bus::Exception If an unexpected Bus error occurred.

virtual Boolean IT_Bus::TransactionSystem::commit_transaction ( Boolean  report_heuristics  )  throw ((Exception)) [pure virtual]

Marks the successful end of a transactional unit of work.

This operates on the transaction associated with the calling thread. Any enlisted transaction participants will be requested to commit. Any enlisted notification participants will be informed of the outcome of the commit action.

Parameters:
report_heuristics If supported by the underlying transaction provider, specifies whether heuristic decisions should be reported during the commit protocol.
Returns:
'true' if the transaction was committed successfully, 'false' if the transaction could not be committed successfully.
Exceptions:
NoActiveTransactionException thrown when a transaction is not currently associated with the calling thread. for example, if beginTransaction() was not called.
IT_Bus::Exception If an unexpected Bus error occurred.

virtual void IT_Bus::TransactionSystem::rollback_transaction (  )  throw ((Exception)) [pure virtual]

Marks the unsuccessful end of a transaction unit of work.

This operates on the transaction associated with the calling thread. This operation causes the entire transaction to be aborted, Any enlisted transaction participants will be instructed to rollback their state to a pre-transaction position. Any enlisted notification participants will be informed that the transaction has been aborted.

Exceptions:
NoActiveTransactionException thrown when a transaction is not currently associated with the calling thread. for example, if beginTransaction() was not called.
IT_Bus::Exception If an unexpected Bus error occurred.

virtual TransactionManager& IT_Bus::TransactionSystem::get_transaction_manager ( const String tx_manager_type = DEFAULT_TRANSACTION_TYPE  )  throw ((Exception)) [pure virtual]

Return an interface that allows more detailed interaction with the transaction associated with the calling thread.

If a provider for the requested transactoin manager type cannot be loaded, an TransactionSystemUnavailableException will be raised.

The currently active transaction manager can be obtained by passing DEFAULT_TRANSACTION_TYPE as the parameter to this operation.

See the IT_Bus::TransactionManager interface for more information on available operations.

Parameters:
String inticates the type of transaction manager that is required. If a transaction provider plugin is not available for the requested transaction type then a Bus exception will be raised. Currently supported values for this element are: DEFAULT_TRANSACTION_TYPE, WSAT_TRANSACTION_TYPE, OTS_TRANSACTION_TYPE
Returns:
TransactionManager The requested transaction manager. This object can be downcast to the appropiate transaction manager type if necessary. e.g. OTSTransactionManager, WSATTransactionManager, etc.
Exceptions:
TransactionSystemUnavailableException thrown when no transaction system is available to create transaction manager. For example, the appropiate transaction provider plugin is not available or not configured correctly in the Artix config file.
IT_Bus::Exception If an unexpected Bus error occurred.

virtual Boolean IT_Bus::TransactionSystem::within_transaction (  )  [pure virtual]

Determine if a transaction is currently associated with the calling thread.

Returns:
Boolean 'true' is there is a transaction associated with the calling thread. A transaction will be associated with the calling thread if either the IT_Bus::TransactionSystem::begin_transaction() or the IT_Bus::TransactionManager::attach_thread() operations are called.


Generated on Tue Mar 20 15:28:09 2007 for Artix by  doxygen 1.5.1-p1