Follow these instructions for VM.
Function calls to the governor exit routine either precede or follow a specific type of QMF activity. For example, QMF passes control to the governor exit before and after running a command.
When it calls the governor, QMF always branches to an entry point named DSQUnGVx. Therefore, you cannot use the entry point to determine the type of exit. Use instead the control-block field GOVFUNCT. Its value is a positive integer that identifies the type of exit.
QMF calls the governor exit routine during initialization for a QMF session, after the governor exit routine is loaded into the user's virtual storage. The governor initializes itself for the session using the resource control information contained in rows passed from QMF's query of Q.RESOURCE_VIEW.
When a user issues the CONNECT command, the Q.PROFILES table and the resource control table are re-initialized. The governor is called because the resource control values might have changed if a different CONNECT ID was used. All unfinished database operations are completed before the connection is made.
Although the governor exit routine cannot cancel a connection to the database, you can write statements in your own routine that cancel the user's session on the next activity, if the resource information passed to the governor indicates that the user is not allowed to use QMF.
QMF calls the governor before and after running all commands. There can be several calls for the start of commands before a call for the completion of a command. For example, a RUN PROC command results in two "start command" calls and two "end command" calls when there is a RUN QUERY command embedded in the procedure.
QMF calls the governor just before it begins a variety of database operations, such as PREPARE, OPEN, and FETCH; QMF also calls the governor upon completing any database activity.
When QMF retrieves data, it fits the maximum number of rows possible into a buffer that has a minimum size of 4K. QMF calls the governor once upon retrieving the first row into the buffer and once upon either filling the buffer or reaching the end of the table, whichever comes first.
QMF also calls the governor when SQL, QBE, or prompted queries are submitted using RUN QUERY, or when QMF is running queries started by a command. For example, a SAVE DATA command might result in DELETE, CREATE, and INSERT queries. The governor is called before and after each of these operations. If there is an incomplete data object when a command is entered, there might be governor calls for database activity while the data object is being completed. See Solving performance problems for more information on handling problems associated with completing the data object.
The following QMF commands always force database activity:
At various points in a session, QMF waits for users to make decisions. The time QMF spends waiting is known as think time.
QMF calls the governor before performing an operation that leads to think time, such as displaying a panel for a user-entered selection. As soon as the user enters a response and ends the period of think time, QMF calls the governor.
Any of the following activities lead to think time:
QMF calls the governor just before it initiates an abnormal ending. The governor can perform the cleanup necessary before the abend processing begins. The actions might be similar to those during the session end.
QMF calls the governor exit routine by branching to the address of the entry point DSQUnGV2.
QMF calls the governor exit routine by branching to the address of the entry point DSQUnGV2. Upon entry to the governor exit routine:
The parameter list contains two full-word addresses; one for the control block DXEXCBA; the other for the control block DXEGOVA.
Because QMF always branches to an entry point named DSQUnGV2 when it calls the governor, you cannot use these entry points to determine the type of function call; instead, use the GOVFUNCT field of the DXEGOVA control block.
In the IBM-supplied governor exit routine, GOVFUNCT contains a character value that identifies the type of function call. This character value, in turn, equates to a 1-byte binary integer from 1 to 10. For example, on a function call for the start of a QMF session, the value of GOVFUNCT is GOVINIT, which equates to a numeric value of X'1'.
Both character and numeric values for each type of function call are shown below.
GOVINIT EQU 1 -------- INITIALIZATION OF SESSION GOVTERM EQU 2 -------- TERMINATION OF SESSION GOVSCMD EQU 3 -------- START COMMAND GOVECMD EQU 4 -------- END COMMAND GOVCONN EQU 5 -------- CONNECT COMMAND GOVSDBAS EQU 6 -------- START DATA BASE GOVEDBAS EQU 7 -------- END DATA BASE GOVSACTV EQU 8 -------- SUSPEND QMF ACTIVITY GOVRACTV EQU 9 -------- RESUME QMF ACTIVITY GOVABEND EQU 10 -------- QMF ABEND OPERATION
To improve performance in your own exit routine, you can follow the convention the IBM-supplied governor uses, and equate the values of GOVFUNCT with binary numbers by using a branch table. QMF uses the branch table to find the addresses to branch to for each type of function call.
Figure 237 shows an example of some code that identifies branch addresses for the IBM-supplied governor.
XR R07,R07 ZERO REGISTER 7 IC R07,GOVFUNCT IDENTIFY EXIT TYPE SLL R07,2 DETERMINE BRANCH TABLE OFFSET LA R15,FUNBTAB(R07) GET BRANCH TABLE ADDRESS L R15,0(R15) GET BRANCHING ADDRESS BALR R14,R15 BRANCH TO THE APPROPRIATE CODE . . . . . . . . . . . . FUNBTAB DS 0F DC A(BYPASS) VALUE "0" - UNUSED DC A(INIT) VALUE "1" - QMF INITIALIZATION . . . . . . . . . DC A(SUSPEND) VALUE "10" - QMF ABEND IN PROCESS
Because the governor program runs on the same level as the main QMF program, ensure you preserve the QMF environment at every function call. Use the standard assembler RETURN statement to return control to QMF after every call.
[ Previous Page | Next Page | Contents | Index ]