Re: [PDO] Question on Persistent PDO Connections

[email protected] (Lester Caine) Fri, 06 Nov 2009 09:47:59 +0000
Newsgroups php.pdo
Message-ID <[email protected]>
Lukas Kahwe Smith wrote:
> 
>> Lester Caine wrote:
>> > While Firebird keeps the connections open ( and one has to make sure to
>> > shut down apache before doing any database maintenance ) it always
>> > completes a transaction in a current page either committing or if there
>> > is an outstanding error rolling back.
>>
>> Thanks for the confirmation.
> 
> well in the past mysql (not sure of this is also the case with other 
> rdbms extensions for PHP), did not clean up transactions. however i 
> think this is now solved .. but somehow i am not sure.
> 
> you can read about all of these issues here (especially the warning):
> http://de.php.net/manual/en/features.persistent-connections.php
> 
> but i am getting the feeling its not uptodate anymore even for mysql.

I think if you look back through the bug reports you will find various 
problems with 'hung' connections on various of the engines. Currently I 
don't think there are any 'outstanding' problems with the databases that 
stop the connection being dropped, and I think many of the problems were 
at the database end rather than anything to do with the driver. 
Obviously the same problems would have affected PDO as affected the 
generic driver, but it would be useful to find out IF there is anything 
in each database that can cause problems with the reuse of a persistent 
connection. Firebird had a problem at one time with the number of 
connections growing and needing Apache and Firebird restarting to clear 
them, but I'm not seeing that problem currently.

Transaction/locks and the like being held open after a use of the 
connection has finished are probably more of problem than hung 
connections, and this may be more in the control of the driver? But 
ideally the driver's 'destructor' should close anything still open on 
the connection? So that the next time a request is made, the connection 
can be reused.

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php