RE: [PHP-DEV] Bug #729: mysql_connect reuses connection ids

From: Date: Wed, 09 Sep 1998 20:37:49 +0000
Subject: RE: [PHP-DEV] Bug #729: mysql_connect reuses connection ids
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-892@lists.php.net to get a copy of this message
> -----Original Message----- > From: Zeev Suraski [mailto:bourbon@netvision.net.il] > Sent: Wednesday, September 09, 1998 6:15 PM > To: Shane Caraveo; walton@nordicdms.com; php-dev@lists.php.net > Subject: RE: [PHP-DEV] Bug #729: mysql_connect reuses connection ids > > > At 12:34 09/09/98 -0400, Shane Caraveo wrote: > >It only re-uses when connecting to the same database. Why > have multiple > >connections to the same database? It just creates more > overhead in your > >script, your doubling (or more) you connections so you will > run out of > >connections faster, and if coding carefully, there just is > no need for it. > > It causes problems since you can't 'black-box' any code portion that > connects to an SQL server and disconnects from it, since > disconnecting may > close other instances of that same link, outside the black-boxed code. > Hmm, didn't entirly think of that, but it's still easy enough to work around in userland. Anyway, just to do away with it alltogether, maybe an optional parameter that specifies to use a new connection then. so mysql_connect(db,user,password,opt) opt=true=new connection BTW Zeev, I've just finished getting a new client library of mysql going that is now realy thread safe (it wasn't before, not that that matters in 3.0). But we cannot acces mysql_port directly, we need to use mysql_real_connect to set the port. Shane -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#892) next »