Re: [PDO] Question on Persistent PDO Connections
| From: | Lester Caine | Date: | Fri, 06 Nov 2009 08:38:17 +0000 |
| Subject: | Re: [PDO] Question on Persistent PDO Connections | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.pdo |
| Request: | Send a blank email to pdo+get-307@lists.php.net to get a copy of this message | ||
Christopher Jones wrote:
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#ADFNS802What happens in this example where the suspended transaction is never completed? Sounds like a recipe for disaster to me ;) Once a transaction is opened in Firebird, the MGA (Multi Generational Architecture) maintains a snapshot of the current state of records. Changes by other transactions can only be made if not blocked by other un-committed transactions, but everybody gets a clean view of the database. Holding transactions open maintains the view at the time the transaction was opened, and if not refreshed a some point, the 'last active transaction' counter does not advance. These means that long time running reports generate a clean set of results from that particular time - not broken by other activity on the database while the query was running. SO suspending a transaction would cause a major bottleneck that may block the database at some point if not cleared :( -- 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