If you have packages and still want to use dynamic plan switching techniques

For dynamic plan switching users, if the value of a modifiable special register (for example, the CURRENT PACKAGESET register) is changed during processing and not reset to the initial state before the SYNCPOINT is taken, the following occur:
  • The thread is not released by the CICS Db2® attachment facility.
  • Thread reuse does not occur because the task continues to use this thread with the same plan allocated.
  • Dynamic plan switching does not occur because the same thread and plan are used; that is, the dynamic plan switching exit is not taken on the first SQL statement issued following the SYNCPOINT.

Therefore you should take care to ensure that any modifiable special register is reset to its initial value before the SYNCPOINT is taken if you want to use dynamic plan switching. SQL: The language of Db2 in Db2 for z/OS product documentation lists the modifiable special registers.