![]() |
Overview Modifies the transaction such that it cannot be committed, but can only be rolled back. Original interface CosTransactions::Current Interface Exceptions NoTransaction
Intended Usage
If there is no transaction associated with the current thread, the NoTransaction exception is raised.
The effect of this request is equivalent to performing the rollback_only Operation in the corresponding Coordinator Interface.
IDL Syntax
void rollback_only() raises(NoTransaction);
Input parameters
None.
Return values
None.
Examples
The following examples demonstrate the usage of CosTransactions::Current::rollback_only.
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 rollback_only operation on the CosTransactions::Current object. current->rollback_only(); ...
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 rollback_only operation on the org.omg.CosTransactions.Current // object. current.rollback_only(); ...