Current::suspend

Overview Returns an object that represents the transaction context currently associated with the current thread, and disassociates the currently associated transaction context from the current thread.
Original interface CosTransactions::Current Interface


Intended Usage

If there is no current transaction, a NULL reference is returned.

This object can be given to the resume operation to reestablish this context in the same, or a different, thread within the same server process.

Syntax

  Control suspend();

Input parameters

Control
Represents the transaction context currently associated with the current thread. The caller should not free the returned object; the Transaction Service retains ownership of it.

Return values

None.

Examples

The following examples demonstrate the usage of CosTransactions::Current::suspend.

C++ Example

  #include <CosTransactions.hh> // CosTransactions module
  ...
  CosTransactions::Control_ptr control = NULL;
  ...
  //Access the CosTransactions::Current object. 
  CORBA::Object_ptr orbCurrentPtr = 
     CBSeriesGlobal::orb()->resolve_initial_references("TransactionCurrent");
  CosTransactions::Current_ptr current = 
     CosTransactions::Current::_narrow(orbCurrentPtr);
  ...
  // Invoke the begin operation on the CosTransactions::Current object.
  current->begin();
  ...
  // Suspend the association between the transaction and the thread.
  control = current->suspend();
  if (!control)
  {
      // There was no transaction associated with this thread prior to the
      // suspend. Perform appropriate action.
      cout << "Error: No transaction prior to suspend" << endl;
  }

Related reference
CosTransactions in the transaction service



Searchable topic ID:   rcor_ctscu0
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/corba/ref/rcor_ctscu0.html

Library | Support | Terms of Use | Feedback