<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                事務不生效,檢查步驟: 1.在事務里操作的表是否都是InnnoDb引擎 2.數據庫是否默認連接【多庫】 3.是否調用DB的beginTransaction commit rollBack等方法,默認模型是不支持事務的 我這里就是因為出現多庫,導致事務不生效,因為以上選項3的方法,默認都是連接config/database.php的mysql默認配置。索引所以如果多庫項目,這里三個方法都要顯示連接當前事務所在的庫,如下 ``` public static function taskSuccess($taskId, $totalNums=0, $successNums=0, $note=''){ DB::connection(self::$connectionSelf)->beginTransaction(); $currentDate = date('Y-m-d H:i:s'); try{ # 主表更新 $where = [ ['id', '=', $taskId] ]; $update = [ 'status'=> self::STATUS['success'], 'update_time'=> $currentDate, 'total_nums'=> $totalNums, 'success_nums'=> $successNums, 'note'=> $note, ]; $update = self::where($where)->update($update); if(!$update){ throw new \Exception('任務執行成功,但更新主表狀態失敗', ErrorCode::DB_UPDATE); } # 從表更新 $where = [ ['last_task_id', '=', $taskId] ]; $update = [ 'status'=> self::STATUS['success'], 'update_time'=> $currentDate, 'note'=> $note, ]; $update = SyncAccountQueue::where($where)->update($update); if(!$update){ throw new \Exception('任務執行成功,但更新從表狀態失敗', ErrorCode::DB_UPDATE); } DB::connection(self::$connectionSelf)->commit(); return true; }catch(\Exception $e){ DB::connection(self::$connectionSelf)->rollBack(); throw new \Exception($e->getMessage(), $e->getCode()); } } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看