There is no active transaction----php

代码如下

$db = app::get('sysshop')->database();
        $db->beginTransaction();

        try
        {
            $objMdlAccount->update($accountDisable, $accountFilter);
            $objMdlSeller->update($data, $accountFilter);

            $db->commit();

            if($userID['user_id']){
                kernel::single('topapi_server')->topapiSellerlog('员工编辑',$userID['user_id'],$params['seller_id'],$sellerInfo['shop_id'],'update','seller');
            }

            return true;


        }
        catch( Exception $e )
        {
            $db->rollback();

            throw new Exception('修改失败');
        }

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

猜你喜欢

转载自blog.csdn.net/ahaotata/article/details/85051064