[imp] Multiple db-connections? (Re: [imp] Still Postgres...)

Rich Lafferty rich@horde.org
Wed, 14 Mar 2001 13:05:14 -0500


On Wed, Mar 14, 2001 at 06:24:28PM +0100, Andreas Schyman (schyman@student.luth.se) wrote:
>
> I realize that this is a bug in php, since one should be able to
> open up multiple connections to a dbs if one wants to.
> 
> I just wonder why you want to open up two identical connections to a
> dbs?  Why not send all queries through the first connection?

Offhand? No idea. Conceptually? There are three ways to handle the
situation in which particular classes need database access, though:
you make the database handle a global (ick!); you somehow pass the
database handle between classes (ick!); or you open a connection to
the database when you need one. The latter actually works quite well,
*except* that with this bug, as soon as one of those handles falls out
of scope and autocloses, the rest of the connections (which are still
associated with perfectly good instances of the class in question)
*also* close.

Keep in mind that IMP isn't exactly procedural; you can open up a
"Contacts" window, then a "Compose" window, then a second "Contacts"
window, close the first "Contacts" window, close the "Compose" window,
and then still have the second "Contacts" window working. :-)

  -Rich

-- 
------------------------------ Rich Lafferty ---------------------------
 Sysadmin/Programmer, Instructional and Information Technology Services
   Concordia University, Montreal, QC                 (514) 848-7625
------------------------- rich@alcor.concordia.ca ----------------------