Overview | Sets the timeout value to be used for all subsequent transactions. |
Original interface | CosTransactions::Current Interface |
Exceptions | INITIALIZE standard exception |
Intended Usage
Subsequent transactions created are subject to being rolled back if they do not complete within the time limit specified on this parameter. The default value for the time limit is platform dependent. If the parameter is zero, there is no application-specific time limit.
The INITIALIZE standard exception is raised if set_timeout is being used for the first time and the Transaction Service cannot be initialized.
Syntax
void set_timeout(in unsigned long seconds);
Input parameters
Return values
None.
Examples
The following examples demonstrate the usage of CosTransactions::Current::set_timeout.
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 set_timeout operation on the CosTransactions::Current object. current->set_timeout(60 /* seconds */); ... // Start a transaction ...