Re: Re: cvs: pear /MDB2 package.php

From: Date: Fri, 26 Nov 2004 09:49:30 +0000
Subject: Re: Re: cvs: pear /MDB2 package.php
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-34576@lists.php.net to get a copy of this message
Lukas Smith wrote:
Manuel Lemos wrote:
Hello, On 11/25/2004 08:29 PM, Lukas Smith wrote:
+- removed destructor since most RDBMS handle uncommited transaction themselves
RDBMS (the server) would really rollback uncommitted transactions if the clients would have closed the connection. However, when you use persistent connections the RDBMS have no way of knowing that the PHP has exited the script unless the client (Web server process or CGI) exits making the database connection implicitly die. Therefore it seems you are making a big mistake because this feature was not added originally to Metabase for no reason. Dropping this feature will eventually lead to database havoc (read neverending deadlocks), which is what this Metabase feature was intended to solve.
thats a good point. i am just not sure how many people are really affected by this ... especially since handling things yourself is quite straightforward .. just check the "in_transaction" property yourself. especially on php4 registering a shutdown_function is not that cheap since I have to emulate true desctructors (altough people might not like destructors with persistant connections anyways) there. however i must admit I am a bit confused about the current state in regards to persistant connections .. they seem to create alot of issues but obviously stand to improve performance considerably. i must admit my decision was fairly rash ..
So pondering this some more. There should be a disconnect() method. Beyond that there should be a desctructor that is obviously called at script end and before connecting to a new server in the same instance. That destructor will end any open transactions if the connection was presistent and otherwise call disconnect(). Seems means that for people who have persistent connections the destructor will not call disconnect() as it did in the past, but open transactions are cleaned up. Oh while we are at it Manuel .. the uncommitedtransactions property in the oci8 driver is there because oci8 supports nested transactions? regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07

« previous php.pear.dev (#34576) next »