The DB2 Interface

The Com-plete/DB2 interface uses the Resource Recovery Services attachment facility (RRSAF) of DB2. Since RRSAF, differently from CAF, allows the running of more than one DB2 connection per TCB, allocation of a separate task group with one TCB per user is no longer necessary.

All DB2 related processing for a given user runs under control of the same TCB as his application (usually, Natural).

The DB2 load-library (DSNLOAD) must be concatenated to the COMPLIB load library chain, because all relevant modules will be loaded dynamically.

During startup, Com-plete attempts to connect to DB2 using an RRSAF IDENTIFY call. If the DB2 subsystem does not accept connections, Com-plete waits for a notification from DB2 and connects when this notification arrives. When DB2 notifies Com-plete about DB2 termination, Com-plete terminates all users’ DB2 sessions, issues a TERMINATE IDENTIFY call for the master (or “watchdog”) connection, and waits for a reconnect notification from DB2.

Initialization

The DB2 interface is initialized using the following SYSPARM definitions:

SERVER=(DB2,TLINDB2,ssid,plan)

where:

ssid The DB2 subsystem ID for the RRSAF IDENTIFY call.
plan The default plan name if the application does not use an explicit open.

Accounting and Monitoring

Com-plete provides the following information to DB2 on the IDENTIFY and SIGNON calls for each user/application:

Identifier (DB2 terminology) Value (Com-plete terminology)
accounting-token Accounting information for the user as defined in UUTIL UM.
user User ID
application Program name (8 bytes) +
Task group name (8 bytes) +
Thread group name (8 bytes)
workstation LU name (TIB name)

User Interface

Software AG recommends that Natural be used for programming DB2 applications. DB2 services for the application are provided via a standard RRSAF function call to the following DB2 modules:

DSNRLI
DSNWLIR
DSNHLIR

The user application can supply a DB2 plan name by issuing an OPEN call providing the plan name to be used. If no explicit OPEN is received prior to an SQL call, the Com-plete/DB2 interface will issue implicit IDENTIFY, SIGNON, and CREATE_THREAD calls, with the plan name specified in the SERVER sysparm definition.

Operator Commands

The following operator commands can be used to operate the DB2 server without having to restart Complete:

SERV INIT DB2 TLINDB2 ssid plan Starts the Com-plete/DB2 interface the way the SERVER statement described above would.
SERV TERM DB2 Terminates the Com-plete/DB2 interface the way it terminates during Com-plete shutdown.
SERV DB2 DISC Terminates all users’ DB2 sessions and issues a TERMINATE IDENTIFY call for the watchdog connection, but does not delete DB2 modules or reset statistics.
SERV DB2 CONN After a SERV DB2 DISC: Issues an IDENTIFY for the watchdog connection, and allows users to use DB2 again.