Re: PEAR::DB - DB::connect inconsistency using mysql?
| From: | Lukas Smith | Date: | Fri, 26 Nov 2004 12:04:46 +0000 |
| Subject: | Re: PEAR::DB - DB::connect inconsistency using mysql? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15827@lists.php.net to get a copy of this message | ||
Luis Correa D'Almeida wrote:
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!this is a problem inside the mysql extension .. there is nothing PEAR::DB can do against this. regards, Lukas