Re: [PDO] Question on Persistent PDO Connections
[email protected] (Lukas Kahwe Smith) Fri, 6 Nov 2009 00:47:14 +0100
| Newsgroups | php.pdo |
|---|---|
| Message-ID | <[email protected]> |
On 05.11.2009, at 20:47, Christopher Jones wrote: > > > Ulf Wendel wrote: > > PDO specs: define how PDO drivers may/shall behave > > PDO API: implement bool PDO::resetsPersistentConnection() > > PDO API: options setPersistentConnectionReset() > > > > Choose whatever function name you like as long you end up having: > > > > - a clear statement in the PDO specs what whall happen > > - a documented and portable way to check the status of the > > implementation of a PDO specific feature (here: persistent > > - connections). > > PDO has a way to detect whether a persistent call was made > http://www.php.net/manual/en/pdo.getattribute.php, but there isn't > going to be a PDO DB-portable way to tell whether the DB created the > connection or reused it or reset etc. > > So my clear statement (tm) suggestion is "PHP shall not generically > make any assummptions about the connection state of a new PDO > connection, except that it will not have an open transaction. Some > databases may have optimizations that allow global state information > to be retained from a persistent connection in one script into another > script. The safest practice is to assume that this state is not > carried over and must be reset. Refer to the PDO_xxx driver > documentation for database specific information". hmm yeah .. i guess it would be tricky, since generally i think we should aim to let the RDBMS clean up the session as good as possible if persistent connections are used. regards, Lukas Kahwe Smith [email protected]