17.00 - Terminate the Teradata PT Connection - Parallel Transporter

Teradata® Parallel Transporter Application Programming Interface Programmer Guide

prodname
Parallel Transporter
vrm_release
17.00
created_date
June 2020
category
Programming Reference
featnum
B035-2516-220K

Once a Teradata PT driver task completes, the connection must be terminated. Do this with the Connection object’s Terminate method.

conn->Terminate();

The Terminate method closes all sessions associated with the connection and ends the driver’s processing environment.

Your program should always call Terminate whenever any program fails prematurely, so that Teradata PT can do cleanup tasks such as releasing storage and logging off all DBS sessions. If your program cannot call Terminate and has stopped, you may be able to submit a restart job. If you submit a restart job and get errors, wait until the DBS logs off all orphan sessions (the default time is 20 minutes) and then submit the restart job again.

If you are making direct calls to CLIv2, do not call the DBCHCLN function until all initiated Teradata PT drivers within the same process have been terminated. In addition to freeing shared CLIv2 structures, the DBCHCLN method disconnects all currently connected CLIv2 sessions within the same address space. If you call DBCHCLN while a Teradata PT driver in the same process is still active, the driver’s session will prematurely disconnect and the job will fail.