@Override
    public long releaseOwnedTasks(final String nodeName) {
        LOGGER.info(() -> "Releasing owned tasks for " + nodeName);
        final List<Condition> conditions = new ArrayList<>();

        // Release tasks for the specified nodes.
        final Integer nodeId = processorNodeCache.getOrCreate(nodeName);
        conditions.add(PROCESSOR_TASK.FK_PROCESSOR_NODE_ID.eq(nodeId));

        // Only alter tasks that are marked as queued, assigned or processing,
        // i.e. ignore complete and failed tasks.
        conditions.add(ACTIVE_TASKS_STATUS_CONDITION);

        // Release tasks.
        final long count = releaseTasks(conditions);

        LOGGER.info(() -> "Set " + count + " tasks back to CREATED that were " +
                          "QUEUED, ASSIGNED, PROCESSING");

        return count;
    }
Release tasks and make them unowned.

@param nodeName The node name to release task ownership for.
@return The number of tasks released.
stroom-processor/stroom-processor-impl-db/src/main/java/stroom/processor/impl/db/ProcessorTaskDaoImpl.java