#33624 [Fbk->Opn]: pdo_odbc does not close connections
| From: | gpd at gpdnet dot co dot uk | Date: | Sun, 10 Jul 2005 09:25:40 +0000 |
| Subject: | #33624 [Fbk->Opn]: pdo_odbc does not close connections | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-81627@lists.php.net to get a copy of this message | ||
ID: 33624
User updated by: gpd at gpdnet dot co dot uk
Reported By: gpd at gpdnet dot co dot uk
-Status: Feedback
+Status: Open
Bug Type: PDO related
Operating System: Windows XP/IIS
PHP Version: 5CVS-2005-07-09 (dev)
New Comment:
That's bizarre. If I have connection pooling off, dllhost crashes
immediately. If I have connection pooling on, the connection is closed
at the end of the script so the connection keeps getting re-used with
no problems. 30 secons later, after stopping the test, dllhost crashes.
30 Seconds is my connection pool timeout setting for the SQLServer
driver! So it is not crashing when the connection is logically closed
by pdo, but when it is physically disconnected from the server.
Either way is unworkable. Currently the web app stop working fairly
rapidly. Disabling the pdo disconnects just means the entire server
falls over later because of a huge mass of stale connections.
NOTE: I DO NOT see this behaviour with Sybase SQLAnywhere!!! Whatever
settings I use it is perfectly stable with the latest php snapshot.
It may well be a bug in the SQLServer ODBC, or a bug in pdo that does
not trigger the same issue with SQLAnywhere, but pdo USED to work with
SQLServer, so it must be some recent changes that have triggered the
problem.
Previous Comments:
------------------------------------------------------------------------
[2005-07-09 20:53:30] wez@php.net
Hmmm, I turned that off on my local environment because it would crash
during shutdown, 100% of the time.
I've enabled it again in the snaps; if it doesn't blow up for you in
the next snapshot, then it seems the problem is specific to my machine.
------------------------------------------------------------------------
[2005-07-09 20:19:37] gpd at gpdnet dot co dot uk
Description:
------------
In the latest 5.1 snapshots the pdo_odbc driver does not close
connections to the database server.
run the below code mulitple times by re-requesting the page.
After several requests there are lots of idle connections at the
database server
Tried this with odbc connection pooling on and off.
Tried this with SQLServer and Sybase SQLAnywhere. After a while running
my code there are hundreds of connections on the server, even after
leaving for an hour.
Only killing the dllhost process will free the connections
Even explicitly assigning null to the connection recource does not
disconnect.
Reproduce code:
---------------
$cn = new PDO('odbc:DRIVER={SQL
Server};Server=GARY;Database=cct8740','sa','ashwell');
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33624&edit=1