php caches mysql connections to same host
| From: | dorgon | Date: | Tue, 24 Jun 2003 19:54:17 +0000 |
| Subject: | php caches mysql connections to same host | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-152651@lists.php.net to get a copy of this message | ||
Is this a bug or a feature?
I realised that php caches mysql connection even when not using persistent connections! When calling mysql_connect(...host...)
twice, and not closing to first connection I get the same
resource #id the first connection has.
I noticed that, when writing a connectionPool, that opens
n connections to different DSN (data source names, that specify
dbms://user:pwd@host/db in one string).
The problem raises, when I have to different connections to the
same mysql host but different databases. Then the second connection
is taking the first, but the first is used by another class.
The only solution is to do a mysql_select_db before every query.
Is this a bug or a feature?
/dorgon