def METHOD_NAME(self, args, source, target, limit):
    """
    Moves work from buffer in or main queue to the buffer out
    table.
    """
    sqlStr1 = ''
    sqlStr2 = ''
    if source in ['tp_threadpool', 'tp_threadpool_buffer_in', \
        'tp_threadpool_buffer_out']:
        # we need a for update in the select to prevent (harmless) deadlock
        # situations with innodb
        sqlStr1 = """