DCE Application Programming Guide

Application Programming With NonStop DCE
Threads
HP NonStop DCE Application Programming Guide429551-003
3-12
NonStop DCE Jacket Routines
DCE_ENDTRANSACTION()
DCE_RESUMETRANSACTION()
The syntax and semantics of these function calls are the same as those of the similarly
named TMF calls.
When using TMF transaction jackets:
The transaction_tag parameter of the DCE_BEGINTRANSACTION() function
is not optional.
Each thread can have at most one current transaction. A call to the Guardian
RESUMETRANSACTION procedure is automatically performed during thread
dispatch to ensure that the correct transaction context is maintained.
Each transaction is initially associated with only the thread that created it by calling
the DCE_BEGINTRANSACTION() function.
Another thread can be associated with a specific transaction by using the
DCE_RESUMETRANSACTION() function and specifying the transaction_tag
value returned by the initial DCE_BEGINTRANSACTION() function call.
If a thread is created, it does not inherit its parent's transaction; the created
thread's transaction context is nil.
If a thread terminates or is destroyed while it has an active transaction, that
transaction is then inaccessible from the process. Use exception handlers for
pthread_cancel_e if cancellation is a possibility. Alternatively, use the
pthread_cleanup_push() and pthread_cleanup_pop() functions to ensure
that the transaction is terminated if the thread exits or is canceled.
If a transaction is aborted by an operator, network partition, or another process, an
error is reported when the initiating thread attempts to operate on the transaction.
A process using TMF transaction demarcation jackets must not call:
°
The TMF procedures BEGINTRANSACTION, ABORTTRANSACTION,
ENDTRANSACTION, and RESUMETRANSACTION
°
The SQL/MP BEGIN-WORK and COMMIT-WORK procedures
A SERVERCLASS_SEND_ operation propagates the current thread’s transaction
to the receiving Pathway server. RPCs do not propagate a transaction to a DCE
server.
A process can perform a maximum of 100 concurrent transactions. If this
maximum is exceeded, a call to the DCE_BEGINTRANSACTION() function fails,
returning error number 83 (too many transactions).
Appendix C, NonStop DCE Jacket Functions, contains reference information for TMF
transaction jackets.