[Enterprise Extensions only]

Current::begin

Overview Creates a new transaction.
Original interface CosTransactions::Current Interface
Exceptions SubtransactionsUnavailable
INITIALIZE standard exception


Intended Usage

The transaction context of the current thread is modified so that the thread is associated with the new transaction.

The SubtransactionsUnavailable exception is raised if the current thread already has an associated transaction and the transaction framework does not support subtransactions, or the current transaction is completing.

The INITIALIZE standard exception is raised if begin is being used for the first time and the Transaction Service cannot be initialized.

IDL Syntax

  void begin() raises(SubtransactionsUnavailable); 

Input parameters

None.

Return values

None.

Examples

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

C++ Example

  #include <CosTransactions.hh> // CosTransactions module
  ...
  //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();
  ...

Java Example

  import org.omg.CosTransactions.*;  // CosTransactions module
  ...
  //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);
  ...
  // Invoke the begin operation on the org.omg.CosTransactions.Current object.
  current.begin();
  ...