TP6 There is no active transaction

浏览:990 发布日期:2020/06/03 分类:ThinkPHP6专区 关键字: 事务
用的是sqlserver数据库,在Db::startTrans(); 就直接报错,导致catch的时候DB:rollback报错:There is no active transaction。
-------------------------------------------
try{
//Db::startTrans();
Db::table($this->tableName)->insert($postData);
$this->addTravelDetails($postData);
//Db::commit();
return $this->responseSuccess($postData);
}catch (\Exception $exception){
//Db::rollback();
return $this->responseFail('保存失败,请重试!', $exception);
}
最佳答案
评论( 相关
后面还有条评论,点击查看>>