errorInfo, $ex->errorInfo[1]) && $ex->errorInfo[1] >= 2000 && $ex->errorInfo[1] < 3000) { AmqpLoger::log('reconnectDB', $ex->errorInfo); $this->db->close(); $this->db->open(); parent::prepare($forRead); } else { throw $ex; } } } protected function internalExecute($rawSql) { try { parent::internalExecute($rawSql); } catch (Exception $ex) { if(isset($ex->errorInfo, $ex->errorInfo[1]) && $ex->errorInfo[1] >= 2000 && $ex->errorInfo[1] < 3000) { AmqpLoger::log('reconnectDB', $ex->errorInfo); $this->db->close(); $this->db->open(); $this->pdoStatement = $this->db->pdo->prepare($rawSql); parent::internalExecute($rawSql); } else { throw $ex; } } } }