Re: [PDO] Question on Persistent PDO Connections
| From: | Christopher Jones | Date: | Fri, 06 Nov 2009 08:11:07 +0000 |
| Subject: | Re: [PDO] Question on Persistent PDO Connections | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.pdo |
| Request: | Send a blank email to pdo+get-306@lists.php.net to get a copy of this message | ||
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.
Just to clarify terms here - what are you referring to by 'session'?Here session refers to the resources used by the PHP connection. In OCI8, session & connection are pretty much synonymous. But if you had a multi-threaded mid-tier you could code an application to have multiple user sessions per physical DB connection. Fundamentally it's a way of resource sharing. The connection is a "pipe" to the DB and the session is the work being done across the pipe.
I would not expect transactions to remain open from one page load to the next, but that seems to be what some people are asking for? Anything that needs to be persistent across page loads should be held either in the database or outside transactions? One can not run a multiuser system if someone is going to start a transaction but not finish it - perhaps due to loss of connection ....Transaction monitors traditionally allow external control of transaction state. In Oracle 11g this has been exposed through to a simple API which is fun: a DB transaction can span multiple HTTP requests. See http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10471/adfns_xa.htm#ADFNS802 Chris -- Blog: http://blogs.oracle.com/opal Twitter: http://twitter.com/ghrd