我在Zend Framework中使用以下代码进行事务处理,但回滚函数不起作用(数据通过insertSome($ data)插入数据库).怎么了?
$db->beginTransaction();
try{
$model->insertSome($data);
$model->insertAll($data2); //this line cannot be run and the whole transaction should be rolled back.
$db->commit();
} catch (Exception $e) {
$db->rollBack();
echo $e->getMessage();
}
Run Code Online (Sandbox Code Playgroud)