#include <it_bus/transaction_system.h>
Inheritance diagram for IT_Bus::TransactionSystem:
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 () IT_THROW_DECL((Exception))=0 |
Marks the beginning of a transactional unit of work. | |
virtual Boolean | commit_transaction (Boolean report_heuristics) IT_THROW_DECL((Exception))=0 |
Marks the successful end of a transactional unit of work. | |
virtual void | rollback_transaction () IT_THROW_DECL((Exception))=0 |
Marks the unsuccessful end of a transaction unit of work. | |
virtual TransactionManager & | get_transaction_manager (const String &tx_manager_type=DEFAULT_TRANSACTION_TYPE) IT_THROW_DECL((Exception))=0 |
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 TransactionParticipant * | get_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 |
virtual void IT_Bus::TransactionSystem::begin_transaction | ( | ) | [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.
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 | ) | [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.
report_heuristics | If supported by the underlying transaction provider, specifies whether heuristic decisions should be reported during the commit protocol. |
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 |
) | [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.
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 |
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 void IT_Bus::TransactionSystem::rollback_transaction | ( | ) | [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.
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 Boolean IT_Bus::TransactionSystem::within_transaction | ( | ) | [pure virtual] |
Determine if a transaction is currently associated with the calling thread.