[Enterprise Extensions only]

Current::get_status

Overview Determines the status of the current transaction.
Original interface CosTransactions::Current Interface


Intended Usage

If there is no transaction associated with the current thread, the StatusNoTransaction value is returned.

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

IDL Syntax

  Status get_status();

Input parameters

None.

Return values

Status
The status of the current transaction.

Examples

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

C++ Example

#include <CosTransactions.hh>
{
   CosTransactions::Current_ptr my_current;
   CosTransactions::Status_ptr status;
   ...
   // Access the CosTransactions::Current object.
   CORBA::Object_ptr orbCurrentPtr = 
     CBSeriesGlobal::orb()->resolve_initial_references("TransactionCurrent");
   my_current = CosTransactions::Current::_narrow(orbCurrentPtr);
   status = my_current->get_status();
   ...
}

Java Example

import org.omg.CosTransactions.*;
{
   org.omg.CosTransactions.Current my_current;
   org.omg.CosTransactions.Status status;
   ...
   // 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);
   status = my_current.get_status();
   ...
}