Thread release

Transactions release the thread they are using at different times depending on whether the transaction is terminal-oriented and the options that have been specified.

If the transaction is terminal-oriented, or if it is non-terminal-oriented  1  and NONTERMREL=YES is specified in the DB2CONN, the thread is released at SYNCPOINT as well as at end of task (EOT). This makes it efficient to use a protected thread for transactions issuing many SYNCPOINTS, if combined with the BIND options ACQUIRE(USE) and RELEASE(DEALLOCATE). In this case the resources to do the following activities are saved for each syncpoint:
  • Terminate and start the thread.
  • Release and acquire the TS locks.
  • Release and copy segments of the plan into the CT.
Threads are not released at SYNCPOINT time if:
  • Held cursors are open.
  • Certain DB2 modifiable special registers are not at their initial value. The DB2 for z/OS: Programming for Java lists these special registers.
  • The DB2 modifiable special register, CURRENT DEGREE, is ever changed during the lifetime of the CICS task.

If the transaction is not terminal-oriented and you specify NONTERMREL=NO, the thread is released at EOT only. You do not need to use a protected thread to get thread reuse after an EXEC CICS SYNCPOINT command. You may still want to use a protected thread if this is a frequently used transaction. The BIND options ACQUIRE(USE) and RELEASE(DEALLOCATE) give the same advantages as for the terminal-oriented transactions with many syncpoints.

Note:  1  Non-terminal-oriented transactions are transactions that are not associated with a terminal.