Bug #11201 Updated: Simultaneous DB Links

From: Date: Tue, 18 Jun 2002 22:32:43 +0000
Subject: Bug #11201 Updated: Simultaneous DB Links
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-11235@lists.php.net to get a copy of this message
ID: 11201 Updated by: sniper@php.net Reported By: andrew@blackecho.net -Status: Duplicate +Status: Closed Bug Type: MySQL related Operating System: RedHat 6.1 PHP Version: 4.0.4pl1 New Comment: Thank you for your bug report. This issue has already been fixed in the latest released version of PHP, which you can download at http://www.php.net/downloads.php Previous Comments: ------------------------------------------------------------------------ [2001-05-30 22:25:14] sniper@php.net Duplicate of #8634 I can also reproduce the effect. --Jani ------------------------------------------------------------------------ [2001-05-30 15:03:12] andrew@blackecho.net (email above is invalid; use andrew@blackecho.ca instead) ------------------------------------------------------------------------ [2001-05-30 15:01:34] andrew@blackecho.net This report is - I beleive - related to another bug (#8634) but that entry is hard to understand. I believe the problem #8634 is having is caused by mysql_connect() using the same resource identifier for two different connections with the exact same host, username & password argument combination. Thus, in #8634's problem, closing either of the two links causes them both to close becuase they share a common resource link. I have a similar problem. I've co-written an abstract database layer object and it's recently come to my attention that the object behaves incorrectly when there are two different databases open on the same host. Through testing I've come to the conclusion that the problem is the mysql_connect() function. Since both databases are on the same system, the Connect() method of my object does not know that the second time it tries to connect that it is receiving a resource link already in user. Consequently, when it sets the active database, it disrupts the first object's connection to IT'S database. While the functionality to preserve resource links and improve performance is certainly laudable, there needs to be some way to connect to the same host through different resource links. Either a parameter added mysql_connect() to force a new connection regardless of whether there is already one open or a new function (mysql_force_connect()?) that has the same functionality without the existant link check. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=11201&edit=1

« previous php.bugs (#11235) next »