'Close this :class:`.Connection`.
This results in a release of the underlying database
resources, that is, the DBAPI connection referenced
internally. The DBAPI connection is typically restored
back to the connection-holding :class:`.Pool` referenced
by the :class:`.Engine` that produced this
:class:`.Connection`. Any transactional state present on
the DBAPI connection is also unconditionally released via
the DBAPI connection\'s ``rollback()`` method, regardless
of any :class:`.Transaction` object that may be
outstanding with regards to this :class:`.Connection`.
After :meth:`~.Connection.close` is called, the
:class:`.Connection` is permanently in a closed state,
and will allow no further operations.'

def close(self):

    try:
        conn = self.__connection
    except AttributeError:
        pass
    else:
        if (not self.__branch):
            conn.close()
        if (conn._reset_agent is self.__transaction):
            conn._reset_agent = None
        del self.__connection
    self.__can_reconnect = False
    self.__transaction = None
