Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

How the linked-in DBH works

&pagelevel(3)&pagelevel

The linked-in DBH is not an autonomous program; its modules are linked into the database application program and run as part of that program.

The linked-in DBH has multi-DB capability, i.e. an application program working with the linked-in DBH can access several databases simultaneously. The program reserves these databases exclusively, which means that, unless the DBH opens them for read-only access (SHARED-RETRIEVAL), no other program can work with them at the same time.

Figure 6: The linked-in DBH

A special connection module must be linked into the application program in addition to the subschema modules (UDSLNKL or UDSLNKA, see the “Application Programming” manual, section “Linking, loading and starting a UDS/SQL-TIAM application program”). This ensures that when the application is started the dynamic binder loader DBL loads the modules of the linked-in DBH. As in the case of the independent DBH, no processing is done directly against the database. Instead, all work is done in the buffer pools of the DBH work area, which corresponds to the buffer pools in the common pool of the independent DBH.
In the case of the linked-in DBH, however, this work area is not located in a memory area shared by a number of tasks (common memory), but in the memory area of the associated task.

The following example shows how a COBOL program can use the linked-in DBH to process a DML statement. The processing sequence is illustrated in the following diagram:

Figure 7: Processing of COBOL DML statement by the linked-in DBH

  1. The subschema module contains the record area, which is at the same time part of the BASE INTERFACE BLOCK (BIB). The record area can be addressed by the application program via the SUB-SCHEMA SECTION.

    The DB application module transfers the data associated with the relevant DML statement to the record area of the BIB.

    The COBOL runtime system places the information needed to process the DML call into the parameter area of the BIB and passes the address of the BIB to the connection module.

  2. The connection module calls the processing modules of the linked-in DBH and passes the address of the BIB.

  3. The DBH processes the DML call, i.e.:

    • If the DML statement is to read data from the database, the DBH supplies the BIB with the required data. To this end, the DBH accesses the buffer pools and conducts a search for the relevant database page. If the page is not yet in the buffer pools, the DBH reads it in from the database.

    • If the DML statement is to write data to the database, the DBH writes the data from the BIB to the relevant database page in the buffer pools. If the page is not yet contained in the buffer pools, the DBH reads it in from the database.

  4. When the DBH finishes processing the DML call, it returns control to the application program.