2008年7月31日星期四

[fw-db] _DB , Transactions usage questions

Hello,

i have a question about Zend_DB

1: I am using transactions and it seems that my try block is not working
correctly.

Here is the code:

$this->_db->beginTransaction();

try {
$this->block->doSomethingOne($one_info_action, $vals);
$this->block->doSomethingTwo($two_info_action, $vals);

$this->_db->commit();

} catch (Exception $e) {
$this->_db->rollBack();
echo $e->getMessage();
}


Is this valid? Will the transaction and try block work correctly (if
doSomethingOne and doSomethingTwo both succeed, then and only then, do the
results commit)? I have a block just like this, but it seems as though some
of the methods succeed, while others dont. Can methods be checked within a
try/transaction block? (i hope this makes sense)

Thanks.
--
View this message in context: http://www.nabble.com/_DB-%2C-Transactions-usage-questions-tp18760601p18760601.html
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: