public static String save(EOEditingContext ec, boolean writeAnyWay, boolean merge) { int tries = 0; String re = ""; while (tries++ < 20) { re = _save(ec, writeAnyWay, merge); if (re == null || re.indexOf("deadlock") == -1) { break; } else { try { Thread.sleep(100); } catch (InterruptedException e) {} log.error("got deadlock, trying to save again"); } } return re;
public static String save(EOEditingContext ec, boolean writeAnyWay) { return save(ec, writeAnyWay, true);
    public static String save(EOEditingContext ec, boolean writeAnyWay, boolean merge) {        int tries = 0;        String re = "";        while (tries++ < 20) {            re = _save(ec, writeAnyWay, merge);            if (re == null || re.indexOf("deadlock") == -1) {                break;            } else {                try { Thread.sleep(100); } catch (InterruptedException e) {}                log.error("got deadlock, trying to save again");            }        }        return re;    }