There is no active transaction----php

我就是我 2022-04-04 13:16 529阅读 0赞

代码如下

  1. $db = app::get('sysshop')->database();
  2. $db->beginTransaction();
  3. try
  4. {
  5. $objMdlAccount->update($accountDisable, $accountFilter);
  6. $objMdlSeller->update($data, $accountFilter);
  7. $db->commit();
  8. if($userID['user_id']){
  9. kernel::single('topapi_server')->topapiSellerlog('员工编辑',$userID['user_id'],$params['seller_id'],$sellerInfo['shop_id'],'update','seller');
  10. }
  11. return true;
  12. }
  13. catch( Exception $e )
  14. {
  15. $db->rollback();
  16. throw new Exception('修改失败');
  17. }

如果事务已提交,但是之后执行sql语句,报错的话
会报There is no active transaction

发表评论

表情:
评论列表 (有 0 条评论,529人围观)

还没有评论,来说两句吧...

相关阅读