PvDisconnectSQLConnection()
Attempts to disconnect an active SQL connection by passing SQL connection Id. Use PvGetSQLConnectionsData and PvSQLConnectionInfo to obtain a valid connection Id.
*Note: Each SQL connection also establishes a MicroKernel Engine connection. Use PvDisconnectMKDEClient to kill those connections.
Header File: monitor.h (See also Header Files)
Function First Available In Library: w3dbav75.dll (Windows), libpsqldti.so (Linux), libpsqldti.dylib (OS X) (See also Link Libraries)
Syntax
BTI_SINT PvDisconnectSQLConnection(
   BTI_LONG           hConnection,
   PVSQLCONNID*       pSQLConnId);
Arguments
 
Address of the PVSQLCONNID structure to identify the SQL connection. SQL connections are obtained with the PvGetSQLConnectionsData()
Return Values
 
Example
BTI_SINT status = 0;
PVSQLCONNINFO connectionInfo;
PVSQLCONNID connId;
status = PvGetSQLConnectionsData (connection, &count);
while (count > 0)
{
status = PvGetSQLConnectionInfo(connection, 0,
&connectionInfo);
connId.u132ProcessId =
connectionInfo.u132ProcessId;
connId.u132ThreadId =
connectionInfo.u132ThreadId;
status = PvDisconnectSQLConnection(connection,
&connId);
status = PvGetSQLConnectionsData (connection,
&count);
}
PvFreeSQLConnectionsData(connection, &count);
Remarks
The following preconditions must be met:
Connection established by PvConnectServer() or if you are performing the operation on a local machine, P_LOCAL_DB_CONNECTION may be used as the connection handle.
See Also
PvStart()
PvConnectServer()
PvGetSQLConnectionsData()
PvGetSQLConnectionInfo()
PvDisconnect()
PvStop()