9.3 Suspending and Resuming a Transaction
At times, it may be desirable to temporarily remove a process from an incomplete transaction and allow it to initiate a different transaction by calling tpbegin() or tpresume()
. For example, suppose a server wants to log a request to the database central event log, but does not want the logging activity to be rolled back if the transaction aborts.
The Oracle Tuxedo system provides two functions that allow a client or server to suspend and resume a transaction in such situations: tpsuspend(3c) and tpresume(3c). Using these functions, a process can:
- Temporarily suspend the current transaction by calling
tpsuspend()
. - Start a separate transaction. (In the preceding example, the server writes an entry to the event log.)
- Commit the transaction started in step 2.
- Resume the original transaction by calling
tpresume()
.