Re: Transactions in mdb2
| From: | Lukas Smith | Date: | Wed, 22 Mar 2006 17:01:11 +0000 |
| Subject: | Re: Transactions in mdb2 | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23394@lists.php.net to get a copy of this message | ||
Paolo Sala wrote:
Yes, I've forgotten to insert a queryAll. I rewrite the code:well you still need to make sure that the table you are operating on is a transaction enabled table handler .. the default_table_handler option for example simply means that MDB2 will create all tables with this table handler by default. MDB2 also determines based on this setting if you are using transactional table handlers or not .. regards, Lukasand the result is a commit even if I have called a rollback. Furthermore the property in_transaction is true: is the rollback function that doesn't works!$options['use_transactions'] = true; $options['default_table_type'] = 'InnoDB'; $mdb2=& MDB2::connect($dsn, $options); if ($mdb2->supports('transactions')) $mdb2->beginTransaction(); $strSQL= 'INSERT INTO [...cut...]';$mdb2->queryAll($strSQL); if ($mdb2->in_transaction) $mdb2->rollback();