Re: Transactions in mdb2

From: Date: Wed, 22 Mar 2006 16:50:20 +0000
Subject: Re: Transactions in mdb2
References: 1 2 3 4 5 6  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23393@lists.php.net to get a copy of this message
Yes, I've forgotten to insert a queryAll. I rewrite the code:
    $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();
and 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! Piviul Piviul

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