PEAR::DB - DB::connect inconsistency using mysql?
| From: | Luis Correa d'Almeida | Date: | Fri, 26 Nov 2004 11:51:42 +0000 |
| Subject: | PEAR::DB - DB::connect inconsistency using mysql? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-15823@lists.php.net to get a copy of this message | ||
Hi,
It seems the DB::connect() method returns a new instance of DB_mysql,
but keeps the same connection if the DSN is the same (looking at the
method and according to PHP's documentation of mysql_connect). This
reveals an inconsistency at the PEAR level, given that you now get a new
instance, but with an existing connection. One would think that getting
a new object would mean getting a new connection. This is a problem when
dealing with transactions: the state of the connection in the object is
lost; there is no reference to whether we are in the middle of a
transaction. Furthermore, an open transaction can be committed using the
new object, but an existing connection!
Is there a reason for such behavior?
Thanks,
Luis