Converting transactions to Db2 packages

You can convert transactions that use dynamic plan exits or switching techniques to use packages instead.

A transaction that currently uses a dynamic plan exit or dynamic plan switching techniques can be converted to use packages as follows:
  • Bind all of the DBRMs contained in the plan associated with the transaction into packages in a single collection.
  • Bind a new plan with a PKLIST containing a single wildcard entry for this collection.
  • Modify the DB2ENTRY entry for this transaction to use the new plan. Protected threads can now be used for this transaction to optimize thread reuse.

You could choose to have a single plan for the whole application, or one plan per transaction.

A similar approach can be taken for converting all CICS® applications, whether they use a dynamic plan exit or not.

Note that high-usage packages can be bound with RELEASE(DEALLOCATE), with low-usage packages bound with RELEASE(COMMIT). This results in the high-usage packages being retained in the plan's package directory until plan deallocation, while the low-usage packages are removed from the directory, and the space in the EDM pool is released. The disadvantage of this approach is that if you use RELEASE(DEALLOCATE) and then need to rebind a highly-used package, you must intervene to force deallocation of the package if it is allocated to a long-running thread. Consider that to rebind a package is less expensive than to rebind a plan, in terms of the time spent doing it.

Using one plan for the application

Using one plan for the application gives the greatest flexibility in defining the DB2ENTRYs and DB2TRANs for the application, because the transactions involved can be grouped to better use protected threads and optimize thread reuse. Follow this procedure to convert to this environment.

Procedure
  1. Bind all DBRMs for the transactions in the application into packages using a single collection such as COLLAPP1.
  2. Bind a new plan, PLANAPP1, with a package list consisting of a single entry, COLLAPP1.*.
    
    BIND PLAN (PLANAPP1) ..... PKLIST (COLLAPP1.*) ..
    
  3. In the DB2ENTRY, replace the dynamic plan exit program name with the name of this new plan. For example, replace PLANEXITNAME=DSNCUEXT with PLAN=PLANAPP1.