'Separate this connection from its Pool.
This means that the connection will no longer be returned to the
pool when closed, and will instead be literally closed.  The
containing ConnectionRecord is separated from the DB-API connection,
and will create a new connection when next used.
Note that any overall connection limiting constraints imposed by a
Pool implementation may be violated after a detach, as the detached
connection is removed from the pool\'s knowledge and control.'

def detach(self):

    if (self._connection_record is not None):
        _refs.remove(self._connection_record)
        self._connection_record.fairy_ref = None
        self._connection_record.connection = None
        self._pool._do_return_conn(self._connection_record)
        self.info = self.info.copy()
        self._connection_record = None
