Terminating a Session - Call-Level Interface Version 2

Teradata® Call-Level Interface Version 2 Reference for Workstation-Attached Systems

Product
Call-Level Interface Version 2
Release Number
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-04-19
dita:mapPath
xen1544831946512.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2418
lifecycle
previous
Product Category
Teradata Tools and Utilities

After all processing is complete for a session, the application should terminate the session.

If a transaction is in progress at the time of the disconnect (that is, no ET has been issued), the Teradata Server will roll back any work done for the transaction.

Application

In the DBCAREA, the application supplies the session id of the session to be terminated and sets the function code to disconnect (DBFDSC). Then it calls DBCHCL.

DBCHCL

DBCHCL generates a dummy request (including RCB and buffers). DBCHCL builds a Logoff parcel in the message body part of the Request Buffer for the dummy request. DBCHCL then sets the function code in the MTDP Control Block to MTDPLOFF and calls MTDP.

MTDP

MTDP terminates the session and then returns control to DBCHCL.

DBCHCL

All the requests attached to the disconnected session are removed by deallocating their buffers and RCBs, and then the associated SCB are removed from the session queue and returns it to the free memory pool. DBCHCL then returns a success code to the application program. If the return code in the MTDP Control Block is abnormal, DBCHCL returns an error message to the application.

Application

If the return code in the DBCAREA is not normal the application makes the appropriate changes and re-submits the DBCAREA to DBCHCL, as described above. Otherwise, the session is terminated.