Sets the timeout value for subsequent EAServer transactions. The transaction is rolled back if it does not complete before the timeout expires.
CORBACurrent objects
CORBACurrent.SetTimeout ( seconds )
Argument |
Description |
---|---|
CORBACurrent |
Reference to the CORBACurrent service instance |
seconds |
An unsignedlong that specifies the number of seconds that elapse before a transaction is rolled back |
Boolean. Returns true if it succeeds and false if an error occurs.
The SetTimeout function specifies the number of seconds that can elapse before a transaction is rolled back. The timeout period applies to transactions created by subsequent invocations of BeginTransaction. If seconds is 0, no timeout period is in effect.
SetTimeout can be called by a client or a component that is marked as OTS style. EAServer must be using the two-phase commit transaction coordinator (OTS/XA).
This example shows the use of SetTimeout to set the timeout period to five minutes:
// Instance variables: // CORBACurrent corbcurr boolean lb_timeout integer li_rc li_rc = this.GetContextService("CORBACurrent", & corbcurr) IF li_rc <> 1 THEN // handle the error END IF li_rc = corbcurr.Init( "iiop://server1:9003") IF li_rc <> 1 THEN // handle the error ELSE lb_timeout = corbcurr.SetTimeout(300) li_rc = corbcurr.BeginTransaction() END IF