public LockException(Object failed, int timeout, int lockLevel) { super(_loc.get("lock-timeout", Exceptions.toString(failed), String.valueOf(timeout))); setFailedObject(failed); setTimeout(timeout); setLockLevel(lockLevel); }
/** * This method is to provide override for non-JDBC or JDBC-like * implementation of checking lock from the result set. */ protected void checkLock(ResultSet rs, OpenJPAStateManager sm, int timeout) throws SQLException { if (!rs.next()) throw new LockException(sm.getManagedInstance(), timeout); return; } }
public LockException(Object failed, int timeout) { super(_loc.get("lock-timeout", Exceptions.toString(failed), String.valueOf(timeout))); setFailedObject(failed); setTimeout(timeout); }
LockException e = new LockException(sm.getPersistenceCapable(), timeout, level); e.setCause(se); e.setFatal(dict.isFatalException(StoreException.LOCK, se) || level >= MixedLockLevels.LOCK_PESSIMISTIC_READ); throw e;
} else if (subtype == StoreException.LOCK || cause instanceof LockException) { LockException lockEx = (LockException) (ke instanceof LockException ? ke : cause); if (lockEx != null && lockEx.getLockLevel() >= MixedLockLevels.LOCK_PESSIMISTIC_READ) { if (!lockEx.isFatal()) { e = new org.apache.openjpa.persistence.LockTimeoutException(msg, nested, failed); } else {
/** * Convert the specified exception into a {@link StoreException}. */ public static OpenJPAException getStore(String msg, SQLException se, Object failed, DBDictionary dict, int level) { if (msg == null) msg = se.getClass().getName(); SQLException[] ses = getSQLExceptions(se); OpenJPAException storeEx = (dict == null) ? new StoreException(msg).setFailedObject(failed) .setNestedThrowables(ses) : dict.newStoreException(msg, ses, failed); if (level != -1 && storeEx.getSubtype() == StoreException.LOCK) { LockException lockEx = (LockException) storeEx; lockEx.setLockLevel(level); } return storeEx; }
public LockException(Object failed) { super(_loc.get("lock-failed", Exceptions.toString(failed))); setFailedObject(failed); }
LockException e = new LockException(sm.getPersistenceCapable(), timeout, level); e.setCause(se); e.setFatal(dict.isFatalException(StoreException.LOCK, se) || level >= MixedLockLevels.LOCK_PESSIMISTIC_READ); throw e;
} else if (subtype == StoreException.LOCK || cause instanceof LockException) { LockException lockEx = (LockException) (ke instanceof LockException ? ke : cause); if (lockEx != null && lockEx.getLockLevel() >= MixedLockLevels.LOCK_PESSIMISTIC_READ) { if (!lockEx.isFatal()) { e = new org.apache.openjpa.persistence.LockTimeoutException(msg, nested, failed); } else {
/** * Convert the specified exception into a {@link StoreException}. */ public static OpenJPAException getStore(String msg, SQLException se, Object failed, DBDictionary dict, int level) { if (msg == null) msg = se.getClass().getName(); SQLException[] ses = getSQLExceptions(se); OpenJPAException storeEx = (dict == null) ? new StoreException(msg).setFailedObject(failed) .setNestedThrowables(ses) : dict.newStoreException(msg, ses, failed); if (level != -1 && storeEx.getSubtype() == StoreException.LOCK) { LockException lockEx = (LockException) storeEx; lockEx.setLockLevel(level); } return storeEx; }
public LockException(Object failed) { super(_loc.get("lock-failed", Exceptions.toString(failed))); setFailedObject(failed); }
public LockException(Object failed, int timeout, int lockLevel) { super(_loc.get("lock-timeout", Exceptions.toString(failed), String.valueOf(timeout))); setFailedObject(failed); setTimeout(timeout); setLockLevel(lockLevel); }
LockException e = new LockException(sm.getPersistenceCapable(), timeout, level); e.setCause(se); e.setFatal(dict.isFatalException(StoreException.LOCK, se) || level >= MixedLockLevels.LOCK_PESSIMISTIC_READ); throw e;
} else if (subtype == StoreException.LOCK || cause instanceof LockException) { LockException lockEx = (LockException) (ke instanceof LockException ? ke : cause); if (lockEx != null && lockEx.getLockLevel() >= MixedLockLevels.LOCK_PESSIMISTIC_READ) { if (!lockEx.isFatal()) { e = new org.apache.openjpa.persistence.LockTimeoutException(msg, nested, failed); } else {
/** * This method is to provide override for non-JDBC or JDBC-like * implementation of checking lock from the result set. */ protected void checkLock(ResultSet rs, OpenJPAStateManager sm, int timeout) throws SQLException { if (!rs.next()) throw new LockException(sm.getManagedInstance(), timeout); return; } }
/** * Convert the specified exception into a {@link StoreException}. */ public static OpenJPAException getStore(String msg, SQLException se, Object failed, DBDictionary dict, int level) { if (msg == null) msg = se.getClass().getName(); SQLException[] ses = getSQLExceptions(se); OpenJPAException storeEx = (dict == null) ? new StoreException(msg).setFailedObject(failed) .setNestedThrowables(ses) : dict.newStoreException(msg, ses, failed); if (level != -1 && storeEx.getSubtype() == StoreException.LOCK) { LockException lockEx = (LockException) storeEx; lockEx.setLockLevel(level); } return storeEx; }
public LockException(Object failed) { super(_loc.get("lock-failed", Exceptions.toString(failed))); setFailedObject(failed); }
public LockException(Object failed, int timeout, int lockLevel) { super(_loc.get("lock-timeout", Exceptions.toString(failed), String.valueOf(timeout))); setFailedObject(failed); setTimeout(timeout); setLockLevel(lockLevel); }
LockException e = new LockException(sm.getPersistenceCapable(), timeout, level); e.setCause(se); e.setFatal(dict.isFatalException(StoreException.LOCK, se) || level >= MixedLockLevels.LOCK_PESSIMISTIC_READ); throw e;
} else if (subtype == StoreException.LOCK || cause instanceof LockException) { LockException lockEx = (LockException) (ke instanceof LockException ? ke : cause); if (lockEx != null && lockEx.getLockLevel() >= MixedLockLevels.LOCK_PESSIMISTIC_READ) { if (!lockEx.isFatal()) { e = new org.apache.openjpa.persistence.LockTimeoutException(msg, nested, failed); } else {