/** * Destructor. */ public function __destruct() { $this->disconnect(); unset($this->sqlite3); unset($this->db); parent::__destruct(); }
/** * Retry executing the query in case of deadlock error. * * @param DatabaseQueryResult $query The result of the run query * @param Integer $retry_count The max amount of re-executing the query * * @return mixed $return FALSE on failure, mixed otherwise */ protected function result_retry($query, $retry_count = 5) { for ($i = 0; $i < $retry_count; $i++) { if ($query->has_deadlock() === FALSE) { return $query; } $query = $this->db->query($query->query()); } return $query; }
/** * Destructor. */ public function __destruct() { if ($this->connected === TRUE) { $this->rollback(); $this->disconnect(); } unset($this->mysqli); unset($this->rw_host); unset($this->ro_host); unset($this->user); unset($this->pwd); unset($this->db); unset($this->port); unset($this->socket); unset($this->qos_policy); unset($this->query_hint); unset($this->ssl_key); unset($this->ssl_cert); unset($this->ca_cert); unset($this->ca_path); unset($this->cipher); parent::__destruct(); }