RE: [PEAR] Re: DB_DataObject Setting the Database Connection
| From: | Sönke Ruempler | Date: | Wed, 01 Dec 2004 12:36:46 +0000 |
| Subject: | RE: [PEAR] Re: DB_DataObject Setting the Database Connection | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-15941@lists.php.net to get a copy of this message | ||
Alan Knowles wrote on Wednesday, December 01, 2004 10:36 AM:
> There shouldnt be any need to - dataobject calls DB to connect to the
> database - if DB already has a connection, then it will reuse the
> existing one anyway, so you shouldnt end up with multiple connections.
Ok that sounds nice, now I have another problem, maybe it has something to
do with that:
At the moment my DataObject always opens 2 connections to the database. That
happens when the DB connection is triggered the first time.
Code:
$do = DB_DataObject::factory('flyer');
After any DB operation - example:
$do->getDatabaseConnection()->setFetchMode(DB_FETCHMODE_ASSOC); (PHP 5
style)
DO connects 2 times as I can see in the MySQL log file. How can this happen?