Problem with PEAR::DB 1.6.x
| From: | Peter Valicek - Senior Cluster Engineer | Date: | Tue, 04 May 2004 11:34:25 +0000 |
| Subject: | Problem with PEAR::DB 1.6.x | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-12292@lists.php.net to get a copy of this message | ||
Hello,
I use the PEAR::DB Class for all my SQL stuff to Oracle and MySQL.
Today I found an issue, where the pear::db connect to mysql db and does not close the connection,
so after browsing around the pages I had arround 20 connections which hasn't been closed.
I'll print here a snip from my code.
##instancer.php
require_once 'DB.php';
$my = DB::connect( $databaseMY['dsn'], $databaseMY['options'] );
$my->setFetchMode(DB_FETCHMODE_ASSOC);
##home.php
$my->disconnect();
Where instancer.php is automaiticalle called by auto_prepend_file() and home.php is the first page where code will occur,
At the end of the page the disconnect() will be called, but it does not appear.
But after disconnect the connection still exist's.
My config to connect is:
$databaseMY = array(
'dsn' => "mysql://test:test@localhost/mytest",
'options' => array(
'persistent' => 'false',
'optimize' => 'performence',
'autofree' => 'true'
)
);
##info
php version: PHP 4.3.2 (cli) (built: Jul 2 2003 21:13:08)
O/S: SPARC Solaris 9
Anyone an hint for me?
Cheers
-Peter