In this section: |
Using extended plan management, you can create application plans that contain multiple procedures. This section discusses both the basic and extended plan management options. Introduction to Adapters for Relational Data Sources introduces application plans, packages, and bind concepts.
With basic plan management, you create a separate DB2 application plan for every MODIFY procedure. You do not have to issue the SET PLAN command, and the adapter automatically establishes and terminates the necessary DB2 threads for each procedure invoked.
The following examples assume that MOD1 and MOD2 are static MODIFY procedures and that a corresponding DB2 application plan exists for each of them:
Step |
MODIFY |
1. |
RUN MOD1 |
2. |
RUN MOD2 |
3. |
RUN MOD2 |
4. |
EX RPT1 |
The adapter takes the following actions:
Then it opens a thread to plan MOD1. If no prior connection existed, it first issues a CAF CONNECT. It establishes the thread to MOD1 with a CAF OPEN.
Note: The settings for AUTOCLOSE and AUTODISCONNECT affect thread retention across invocations of the same procedure, as in items 2 and 3. Some settings sever a thread and/or connection to DB2, either at the conclusion of any procedure, or within the procedure itself. More information is available in Controlling Connection Scope.
With extended plan management, you can create a DB2 application plan that contains more than one procedure. You must issue the SET PLAN command to establish an umbrella plan that includes each FOCEXEC to be invoked.
The primary purpose of extended plan management is to limit the amount of overhead involved in plan switching. Therefore, this method of binding is not consistent with the AUTOCLOSE or AUTODISCONNECT options, both of which terminate threads and/or connections to DB2.
The following example assumes that MOD1 and MOD2 have been bound into a plan called BIGPLAN:
Step |
MODIFY |
---|---|
1. |
SQL DB2 SET PLAN BIGPLAN |
2. |
RUN MOD1 |
3. |
RUN MOD2 |
4. |
RUN MOD2 |
5. |
SQL DB2 SET PLAN |
6. |
EX RPT1 |
The adapter takes the following actions:
Another option would be to include the dynamic adapter in BIGPLAN by including the DBRM for RSQL as part of the member list when binding BIGPLAN. This procedure would eliminate the need to reset the plan for dynamic access to DB2. If using this option, skip steps 5 and 6.
Information Builders |