'Ensure that the connection is closed.'

def __del__(self):

    if (not hasattr(self, '_connection')):
        return
    self._sql_logger.debug('closing    connection    to    the    database')
    self._connection.close()
