[Enterprise Extensions only]

Coordinator::is_top_level_transaction

Overview Determines whether the transaction associated with the target object is a top-level transaction.
Original interface CosTransactions::Coordinator Interface


Intended Usage

Determines whether the transaction associated with the target object is a top-level transaction. A transaction is a top-level transaction if it has no parent.

IDL Syntax

  boolean is_top_level_transaction();

Input parameters

tc
A pointer to a Coordinator interface transaction.

Return values

TRUE
The transaction associated with the target object is a top-level transaction.
FALSE
The transaction associated with the target object is not a top-level transaction.

Examples

The following examples demonstrate the usage of CosTransactions::Coordinator::is_top_level_transaction.

C++ Example

  CosTransactions::Coordinator *coord;
  if( coord->is_top_level_transaction() )
  {
      cout << "Coordinator represents a top-level transaction" << endl;
  }
  else
  {
      cout << "Coordinator represents a subtransaction" << endl;
  }

Java Example

  org.omg.CosTransactions.Coordinator coord;
  if( coord.is_top_level_transaction() )
  {
      System.out.println ("Coordinator represents a top-level transaction");
  }
  else
  {
      System.out.println ("Coordinator represents a subtransaction");
  }