Overview | Associates the current thread with the supplied transaction context (in place on any previously associated transaction context). |
Original interface | CosTransactions::Current Interface |
Exceptions | InvalidControl |
INITIALIZE standard exception |
Intended Usage
If the parameter is not valid in the current execution context (that is, it is an object reference with an invalid value), the current thread is associated with no transaction.
The INITIALIZE standard exception is raised if resume is being used for the first time and the Transaction Service cannot be initialized.
Syntax
void resume(in Control which) raises(InvalidControl);
Input parameters
Return values
None.
Examples
The following example demonstrates the usage of CosTransactions::Current::resume.
C++ Example
#include <CosTransactions.hh> // CosTransactions module ... CosTransactions::Control_ptr control = control_parameter; ... //Access the CosTransactions::Current object. CORBA::Object_ptr orbCurrentPtr = CBSeriesGlobal::orb()->resolve_initial_references("TransactionCurrent"); CosTransactions::Current_ptr current = CosTransactions::Current::_narrow(orbCurrentPtr); ... // Resume the association between the transaction and the thread. try { current->resume(control); } catch(CosTransactions::InvalidControl) { cout << "Error: control object passed to resume was invalid" << endl; }