Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messageLuis 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
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.