MySQL Forums
Forum List  »  Connector/ODBC

Connector/ODBC not closing connection properly (Classic ASP/VBS)
Posted by: Zackarias Holtelius
Date: April 22, 2016 06:28AM

I have a Classic ASP web applicaton, connecting to my mySQL using ODBC (5.3).
For some reason, the process is not killed when the connection is closed. In the processlist ("SHOW PROCESSLIST"), the connection is present with the command "Sleep". It is killed first when the number of seconds that corresponds to the wait_timeout value in the my.ini file is reached.

How come the connection is still there (risking to use up the max_connections and max_user_connections limits) after the connection is closed?

Simplified code snippet (VBScript):

<%

sConnection = "DRIVER={MySQL ODBC 5.3 ANSI Driver}; SERVER=localhost; DATABASE=db; UID=user;PWD=xxxxxx;"
Set anslutmySQL = Server.CreateObject("ADODB.Connection")
anslutmySQL.Open(sConnection)

SQL = "SELECT ID FROM table LIMIT 1"
SET RS = anslutmySQL.execute(SQL)
ID = RS("ID")

RS.Close : SET RS = Nohting ' Close recordset
anslutmySQL.Close : SET anslutmySQL = Nothing ' Close connection

%>

Language: Classic ASP
OS: Windows Server 2012 R2 / IIS 8.5 64bit
MySQL: 5.5.45 - MySQL Community Server (GPL)
Connector/ODBC version 5.3 ANSI

Thanks.

Options: ReplyQuote


Subject
Written By
Posted
Connector/ODBC not closing connection properly (Classic ASP/VBS)
April 22, 2016 06:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.