Spire2000
09-23-2005, 01:39 PM
I am having a real problem with an ASP application I am building. The main page is forced to connect to 14 different tables in 2 different databases (it's checking multiple news sources for updates). Once the site moved to production, during peaks times, we are getting "Too Many Connections" errors. I believe I've properly closed all the connections.
I run "show processlist" from the MySQL command line prompt and I discover that all the connections are in sleep mode. So, they don't seem to be closed correctly, though closing a connection isn't rocket science and I can't for the life of me see what could possibly be wrong.
I cannot post my actual code here due to security concerns by my company, but here is the basic structure.
-default.asp consists of three includes. {header.asp / body.asp / footer.asp}
-I open my connections in the header.asp file like so:
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open("Driver={MySQL ODBC 3.51 Driver};SERVER="xxx";DATABASE="xxx";uid="xxx";pwd="xxx";)
Set objConn = objConn.Execute(SELECT * FROM tablexxx)
Set objConn2 = Server.CreateObject("ADODB.Connection")
objConn2.Open("Driver={MySQL ODBC 3.51 Driver};SERVER="xxx";DATABASE="xxx";uid="xxx";pwd="xxx";)
Set objConn2 = objConn2.Execute(SELECT * FROM tablexxx)
Set objConn3 = Server.CreateObject("ADODB.Connection")
objConn3.Open("Driver={MySQL ODBC 3.51 Driver};SERVER="xxx";DATABASE="xxx";uid="xxx";pwd="xxx";)
Set objConn3 = objConn3.Execute(SELECT * FROM tablexxx)
etc....
I then output my body, and then the footer. It is within the footer that I close my connections, like so:
objConn.Close
Set objConn = Nothing
objConn2.Close
Set objConn2 = Nothing
objConn3.Close
Set objConn3 = Nothing
Any ideas what I could be doing wrong? Any help or advice would be greatly appreciated.
I run "show processlist" from the MySQL command line prompt and I discover that all the connections are in sleep mode. So, they don't seem to be closed correctly, though closing a connection isn't rocket science and I can't for the life of me see what could possibly be wrong.
I cannot post my actual code here due to security concerns by my company, but here is the basic structure.
-default.asp consists of three includes. {header.asp / body.asp / footer.asp}
-I open my connections in the header.asp file like so:
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open("Driver={MySQL ODBC 3.51 Driver};SERVER="xxx";DATABASE="xxx";uid="xxx";pwd="xxx";)
Set objConn = objConn.Execute(SELECT * FROM tablexxx)
Set objConn2 = Server.CreateObject("ADODB.Connection")
objConn2.Open("Driver={MySQL ODBC 3.51 Driver};SERVER="xxx";DATABASE="xxx";uid="xxx";pwd="xxx";)
Set objConn2 = objConn2.Execute(SELECT * FROM tablexxx)
Set objConn3 = Server.CreateObject("ADODB.Connection")
objConn3.Open("Driver={MySQL ODBC 3.51 Driver};SERVER="xxx";DATABASE="xxx";uid="xxx";pwd="xxx";)
Set objConn3 = objConn3.Execute(SELECT * FROM tablexxx)
etc....
I then output my body, and then the footer. It is within the footer that I close my connections, like so:
objConn.Close
Set objConn = Nothing
objConn2.Close
Set objConn2 = Nothing
objConn3.Close
Set objConn3 = Nothing
Any ideas what I could be doing wrong? Any help or advice would be greatly appreciated.