[Enterprise Extensions only]

Current::get_transaction_name

Overview Supports debugging by returning a string describing the transaction.
Original interface CosTransactions::Current Interface


Intended Usage

If there is no transaction associated with the current thread, an empty string is returned.

The effect of this request is equivalent to performing the get_transaction_name Operation in the corresponding Coordinator Interface.

IDL Syntax

  string get_transaction_name();

Input parameters

None.

Return values

string
A printable string describing the transaction.

Examples

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

C++ Example

#include <CosTransactions.hh>
{
   CosTransactions::Current_ptr my_current;
   string name;
   ...
   // Access the CosTransactions::Current object.
   CORBA::Object_ptr orbCurrentPtr = 
     CBSeriesGlobal::orb()->resolve_initial_references("TransactionCurrent");
   my_current = CosTransactions::Current::_narrow(orbCurrentPtr);
   name = my_current->get_transaction_name();
   cout << "Current transaction name is " << name << endl;
   ...
}

Java Example

import org.omg.CosTransactions.*;
{
   org.omg.CosTransactions.Current my_current;
   String name;
   ...
   // Access the org.omg.CosTransactions.Current object.
   org.omg.CORBA.Object orbCurrentPtr =
     com.ibm.CBCUtil.CBSeriesGlobal.orb().resolve_initial_references(
        "TransactionCurrent");
   my_current = org.omg.CosTransactions.CurrentHelper.narrow(orbCurrentPtr);
   name = my_current.get_transaction_name();
   System.out.println ("Current transaction name is " + name);
   ...
}