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
16.10
Published
May 2017
Language
English (United States)
Last Update
2018-05-01
dita:mapPath
ggf1488824663364.ditamap
dita:ditavalPath
Audience_PDF_include.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.