DB::singleton() (was: DB_NestedSet DB Reference)
| From: | Michael Wallner | Date: | Wed, 28 Jul 2004 17:06:41 +0000 |
| Subject: | DB::singleton() (was: DB_NestedSet DB Reference) | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-13896@lists.php.net to get a copy of this message | ||
Hi Justin Patrin, you wrote:
> On Wed, 28 Jul 2004 13:03:20 +0200, Andre Gemünd wrote:
>> By the way, why doesn't DB have a singleton method, like LiveUser,
>> where it automatically checks wether there already is an instance?
>>
>> Please tell me if i missed something
>
> Because you can have multiple DB connections in one script. I
> routinely use this for connections to mysql and oracle or mysql on
> two boxes.
Hm, that's not an fully appropriate answer to this question.
A singleton in a DBAL should return one and the same instance
for the same DSN & options.
I for myslef was wondering about that several times - maybe
Daniel can shed some light on it...
Regards,
--
Michael - < mike(@)php.net >
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc