'Mark all connections established within the generation
of the given connection as invalidated.
If this pool\'s last invalidate time is before when the given
connection was created, update the timestamp til now.  Otherwise,
no action is performed.
Connections with a start time prior to this pool\'s invalidation
time will be recycled upon next checkout.'

def _invalidate(self, connection, exception=None):

    rec = getattr(connection, '_connection_record', None)
    if ((not rec) or (self._invalidate_time < rec.starttime)):
        self._invalidate_time = time.time()
    if getattr(connection, 'is_valid', False):
        connection.invalidate(exception)
