CDbCommand failed to execute the SQL statement: SQLSTATE[25P02]: In failed sql transaction: ERROR: current transaction is aborted, commands ignored until end of transaction block BEGIN; -- transaction starts here -- do things if you want SAVEPOINT my_savepoint; -- failing statement here -- all other statements are ignored ROLLBACK TO SAVEPOINT my_savepoint; -- continue your transaction starting from my_savepoint COMMIT;