'Invalidate the DBAPI connection held by this :class:`._ConnectionRecord`.
This method is called for all connection invalidations, including
when the :meth:`._ConnectionFairy.invalidate` or :meth:`.Connection.invalidate`
methods are called, as well as when any so-called "automatic invalidation"
condition occurs.
.. seealso::
:ref:`pool_connection_invalidation`'

def invalidate(self, e=None):

    self.__pool.dispatch.invalidate(self.connection, self, e)
    if (e is not None):
        self.__pool.logger.info('Invalidate    connection    %r    (reason:    %s:%s)', self.connection, e.__class__.__name__, e)
    else:
        self.__pool.logger.info('Invalidate    connection    %r', self.connection)
    self.__close()
    self.connection = None
