Re: MDB2: Nested Transactions

From: Date: Thu, 04 Sep 2008 08:20:43 +0000
Subject: Re: MDB2: Nested Transactions
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-29231@lists.php.net to get a copy of this message
Jennifer Fink wrote:
a.       Begin a nested transaction (nest #1)
$xDbTxn->beginNestedTransaction() returns 1;//is this the savepoint value?
I think that's MDB2_OK, i.e. the transaction was started successfully
2.       Grab data and update the database.
a.       If update fails, begin a second nested transaction (nest #2).
$yDbTxn->beginNestedTransaction() returns 1;//is this the savepoint value?
again, I think it's MDB2_OK. The savepoint name is not returned.
Insert some data into other tables via exec().
1.       If insert fails, rollback the transaction (nest #2).
2.       If insert succeeds, commit the transaction (nest #2).
are you using commit() / rollback()? If you're using nested transactions, you should use completeNestedTransaction() instead, once for each nested transaction you started. HTH Best regards, -- Lorenzo Alberton http://pear.php.net/user/quipo ________________________________________________________________________ Quipo Free Internet: sicuro e veloce senza costi di attivazione e senza canone, 2 e-mail da 50 Mb, 150 Mb di spazio web e molto di più! Registrati gratis: http://www.quipo.it

« previous php.pear.general (#29231) next »