private function AssertSuccess()
    {
        if ($this->db)
        {
            if ($this->IsConnected())
            {
                $errorCode = $this->db->errno;
                if ($errorCode != 0)
                {
                    if ($this->inTransaction)
                        $this->RollBack();

                    throw new DBExceptions\DatabaseException($this->db->error, $errorCode, $this->lastQuery);
                }
            }
            else
            {
                $errorCode = $this->db->connect_errno;
                if ($errorCode != 0)
                {
                    throw new DBExceptions\DatabaseException($this->db->connect_error, $errorCode);
                }
            }
        }
    }