Delinking Connection Libraries

Delinkage Due to Block Exits

The system automatically delinks two connection libraries when a process exits a block in which one of the connection libraries is declared.

Requesting Delinkage

Alternatively, either of the linked library processes can use the DELINKLIBRARY function to delink the connection. When used with connection libraries, the DELINKLIBRARY function affects only one connection and must specify a particular connection index or a SINGLE connection library. DELINKLIBRARY also provides two options for connection libraries that are not available for server libraries: the ORDERLY/ABORT option and the WAIT/DONTWAIT option.

Delinking a library is a very costly operation. For more information, refer to Delinkage Overuse.

ORDERLY/ABORT Option

The ORDERLY/ABORT option indicates what to do if any objects exported through this connection from either side are currently being used. The following are the possible values and their meanings:

  • A value of ORDERLY indicates that the delinkage is delayed until none of the exported objects are in use. The ORDERLY value also prevents any new access to the exported objects while delinkage is taking place. ORDERLY is the default value of the ORDERLY/ABORT option.

  • A value of ABORT causes any processes using objects exported through this connection to be discontinued (possibly including the process that invoked DELINKLIBRARY). The discontinued processes receive a HISTORYCAUSE task attribute value of 2 (PROGRAMCAUSEV) and a HISTORYREASON task attribute value of 101 (LIBCANCELERRV).

WAIT/DONTWAIT Option

The WAIT/DONTWAIT option indicates when control should return from the DELINKLIBRARY function. The following are the possible values and their meanings:

  • A value of WAIT specifies that the DELINKLIBRARY function does not finish until the delinkage is complete. WAIT is the default value of the WAIT/DONTWAIT option.

  • A value of DONTWAIT specifies that the DELINKLIBRARY function finishes as soon as it has initiated the delinkage. If the DONTWAIT value is used, the program can later interrogate the connection attribute STATE to determine if delinkage has completed. Alternatively, the program can issue another DELINKLIBRARY call, perhaps with the WAIT value specified.