![]() |
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.
IDL Syntax
void resume(in Control which) raises(InvalidControl);
Input parameters
- which
- The Control object representing the transaction context.
Return values
None.
Examples
The following examples demonstrate 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; }
Java Example
import org.omg.CosTransactions.*; // CosTransactions module ... org.omg.CosTransactions.Control control = control_parameter; ... //Access the org.omg.CosTransactions.Current object. org.omg.CORBA.Object orbCurrentPtr = com.ibm.CBCUtil.CBSeriesGlobal.orb().resolve_initial_references( "TransactionCurrent"); org.omg.CosTransactions.Current current = org.omg.CosTransactions.CurrentHelper.narrow(orbCurrentPtr); ... // Resume the association between the transaction and the thread. try { current.resume(control); } catch(org.omg.CosTransactions.InvalidControl exc) { System.out.println ("Error: control object passed to resume was invalid"); }