SuspendTransaction PowerScript function
Description
Suspends the EAServer transaction
associated with the calling thread.
Controls
CORBACurrent objects
Syntax
1 |
<span>CORBACurrent</span>.<span>SuspendTransaction</span> ( <span></span><span> </span>) |
Argument |
Description |
---|---|
CORBACurrent |
Reference to the CORBACurrent service |
Return Values
Unsigned long. Returns a handle that
refers to the transaction associated with the thread or 0 if an
error occurs.
Usage
The SuspendTransaction function returns
a handle referring to the transaction associated with the calling
thread. This handle can be passed to the ResumeTransaction function
on the same or a different thread. When SuspendTransaction is
called, the current thread is no longer associated with a transaction.
SuspendTransaction can be called by a client
or a component that is marked as OTS style. must be using the two-phase
commit transaction coordinator (OTS/XA).
Examples
This example shows the use of the SuspendTransaction function
to disassociate the calling thread from the current transaction:
1 |
// Instance variable:<br>// CORBACurrent corbcurr<br>integer li_rc<br>unsignedlong ll_handle<br> <br>// Get and initialize an instance of CORBACurrent<br>...<br>li_rc = corbcurr.BeginTransaction()<br>// do some transactional work<br>ll_handle = corbcurr.<span>SuspendTransaction</span>()<br>// do some nontransactional work<br>li_rc = corbcurr.ResumeTransaction(ll_handle)<br>// do some more transactional work<br>li_rc = corbcurr.CommitTransaction() |