Re: rollback in error handller (was: Re: setting the sequence number using MDB2)
| From: | Lukas Smith | Date: | Wed, 20 Apr 2005 12:56:03 +0000 |
| Subject: | Re: rollback in error handller (was: Re: setting the sequence number using MDB2) | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-18826@lists.php.net to get a copy of this message | ||
Dan Rossi wrote:
On 20/04/2005, at 9:44 PM, Lukas Smith wrote:No and yes. Have a look at the API of the singleton method. Essentially you can pass no parameters at all and then it will return the first instance it finds. If you pass it a DSN it will search for the MDB2 instance with a matching DSN and return that. Maybe I can stick the "db_index" (which uniquely identifies every MDB2 instance) into the MDB2_Error object somewhere that is easily accessible or that can even return the instance of MDB2 that caused the error to occur. This should easily be doable.Dan Rossi wrote:I suppose the internals of innodb rollbacks any transaction ready to be committed so its not table based ? if i set it up from a static method, i would need to send it the db settings to tell its supports transactions too right ? And i would also need to check if a query has been made otherwise dont bother rolling bak etc .. I reckon this should happen internally around the _query method just before raiseError :) So check if supports transactions, somehow check if autocommit is turned off or if beginTransaction was called what you reckon ?How do other people usually do it , with this kind of setup ??you could use MDB2::singleton()
Btw I was wondering when a full release may happen and nomore BC breaks ? :)For MDB2? ... thats still months away. First we need a stable PDO release. regards, Lukas