/** * Get the SQLException object. * * @return the exception */ public SQLException getSQLException() { return (SQLException) getCause(); }
/** * Get the SQLException object. * * @return the exception */ public SQLException getSQLException() { return (SQLException) getCause(); }
/** * Get the SQLException object. * * @return the exception */ public SQLException getSQLException() { return (SQLException) getCause(); }
private long filterConcurrentUpdate(DbException e, long start) { int errorCode = e.getErrorCode(); if (errorCode != ErrorCode.CONCURRENT_UPDATE_1 && errorCode != ErrorCode.ROW_NOT_FOUND_WHEN_DELETING_1) { throw e; } long now = System.nanoTime() / 1000000; if (start != 0 && now - start > session.getLockTimeout()) { throw DbException.get(ErrorCode.LOCK_TIMEOUT_1, e.getCause(), ""); } Database database = session.getDatabase(); int sleep = 1 + MathUtils.randomInt(10); while (true) { try { if (database.isMultiThreaded()) { Thread.sleep(sleep); } else { database.wait(sleep); } } catch (InterruptedException e1) { // ignore } long slept = System.nanoTime() / 1000000 - now; if (slept >= sleep) { break; } } return start == 0 ? now : start; }
private long filterConcurrentUpdate(DbException e, long start) { int errorCode = e.getErrorCode(); if (errorCode != ErrorCode.CONCURRENT_UPDATE_1 && errorCode != ErrorCode.ROW_NOT_FOUND_IN_PRIMARY_INDEX && errorCode != ErrorCode.ROW_NOT_FOUND_WHEN_DELETING_1) { throw e; } long now = System.nanoTime() / 1000000; if (start != 0 && now - start > session.getLockTimeout()) { throw DbException.get(ErrorCode.LOCK_TIMEOUT_1, e.getCause(), ""); } Database database = session.getDatabase(); int sleep = 1 + MathUtils.randomInt(10); while (true) { try { if (database.isMultiThreaded()) { Thread.sleep(sleep); } else { database.wait(sleep); } } catch (InterruptedException e1) { // ignore } long slept = System.nanoTime() / 1000000 - now; if (slept >= sleep) { break; } } return start == 0 ? now : start; }