I'm running CodeIgniter 2 with SQL Anywhere (I have a custom class to handle connection with SAP DLLs).
I have a problem with a transaction containing many queries. One of them is raising an error (returned by a trigger while trying to update a table) : in that case, I want the transaction to be rollbacked at the end of the treatment, as you can see below.
$this->db->trans_start();
$this->db->query('AN SQL QUERY...');
$this->db->query('ANOTHER QUERY...'); //This raises an error
$this->db->trans_complete(); //A rollback is done, and should cancel the first query
I've tried to change following options :
- chained => Off
- continue_after_raiserror => On
- on_tsql_error => Continue
What's weird is that I'm logging my queries : executing them manually in Interactive SQL works well ! It seems that the raised error breaks the transaction.
Could someone help me ?
Thanks