/** * Return a new exception that wraps <code>causes</code>. * However, the details of exactly what type of exception is returned can * be determined by the implementation. This may take into account * DB-specific exception information in <code>causes</code>. */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { OpenJPAException ret = narrow(msg, causes[0], failed); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); }
/** * Return a new exception that wraps <code>causes</code>. * However, the details of exactly what type of exception is returned can * be determined by the implementation. This may take into account * DB-specific exception information in <code>causes</code>. */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { OpenJPAException ret = narrow(msg, causes[0], failed); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); }
/** * Return a new exception that wraps <code>causes</code>. * However, the details of exactly what type of exception is returned can * be determined by the implementation. This may take into account * DB-specific exception information in <code>causes</code>. */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { OpenJPAException ret = SQLExceptions.narrow(msg, causes[0], this); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); }
/** * Return a new exception that wraps <code>causes</code>. * However, the details of exactly what type of exception is returned can * be determined by the implementation. This may take into account * DB-specific exception information in <code>causes</code>. */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { OpenJPAException ret = narrow(msg, causes[0], failed); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); }
/** * Return a new exception that wraps <code>causes</code>. * However, the details of exactly what type of exception is returned can * be determined by the implementation. This may take into account * DB-specific exception information in <code>causes</code>. */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { OpenJPAException ret = narrow(msg, causes[0], failed); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); }
/** * Convert the specified exception into a {@link StoreException}. */ public static OpenJPAException getStore(String msg, SQLException se, Object failed, DBDictionary dict) { if (msg == null) msg = se.getClass().getName(); SQLException[] ses = getSQLExceptions(se); if (dict == null) return new StoreException(msg).setFailedObject(failed). setNestedThrowables(ses); return dict.newStoreException(msg, ses, failed); }
/** * Throw an exception wrapping the given nested exceptions. */ private void throwNestedExceptions(List<Exception> exceps, boolean datastore) { if (exceps == null || exceps.isEmpty()) return; if (datastore && exceps.size() == 1) throw (RuntimeException) exceps.get(0); boolean fatal = false; Throwable[] t = exceps.toArray(new Throwable[exceps.size()]); for (int i = 0; i < t.length; i++) { if (t[i] instanceof OpenJPAException && ((OpenJPAException) t[i]).isFatal()) fatal = true; } OpenJPAException err; if (datastore) err = new StoreException(_loc.get("nested-exceps")); else err = new UserException(_loc.get("nested-exceps")); throw err.setNestedThrowables(t).setFatal(fatal); }
/** * Throw an exception wrapping the given nested exceptions. */ private void throwNestedExceptions(List exceps, boolean datastore) { if (exceps == null || exceps.isEmpty()) return; if (datastore && exceps.size() == 1) throw (RuntimeException) exceps.get(0); boolean fatal = false; Throwable[] t = (Throwable[]) exceps.toArray (new Throwable[exceps.size()]); for (int i = 0; i < t.length; i++) { if (t[i] instanceof OpenJPAException && ((OpenJPAException) t[i]).isFatal()) fatal = true; } OpenJPAException err; if (datastore) err = new StoreException(_loc.get("nested-exceps")); else err = new UserException(_loc.get("nested-exceps")); throw err.setNestedThrowables(t).setFatal(fatal); }
/** * Throw an exception wrapping the given nested exceptions. */ private void throwNestedExceptions(List<Exception> exceps, boolean datastore) { if (exceps == null || exceps.isEmpty()) return; if (datastore && exceps.size() == 1) throw (RuntimeException) exceps.get(0); boolean fatal = false; Throwable[] t = exceps.toArray(new Throwable[exceps.size()]); for (int i = 0; i < t.length; i++) { if (t[i] instanceof OpenJPAException && ((OpenJPAException) t[i]).isFatal()) fatal = true; } OpenJPAException err; if (datastore) err = new StoreException(_loc.get("nested-exceps")); else err = new UserException(_loc.get("nested-exceps")); throw err.setNestedThrowables(t).setFatal(fatal); }
/** * Throw an exception wrapping the given nested exceptions. */ private void throwNestedExceptions(List<Exception> exceps, boolean datastore) { if (exceps == null || exceps.isEmpty()) return; if (datastore && exceps.size() == 1) throw (RuntimeException) exceps.get(0); boolean fatal = false; Throwable[] t = exceps.toArray(new Throwable[exceps.size()]); for (int i = 0; i < t.length; i++) { if (t[i] instanceof OpenJPAException && ((OpenJPAException) t[i]).isFatal()) fatal = true; } OpenJPAException err; if (datastore) err = new StoreException(_loc.get("nested-exceps")); else err = new UserException(_loc.get("nested-exceps")); throw err.setNestedThrowables(t).setFatal(fatal); }
/** * Throw an exception wrapping the given nested exceptions. */ private void throwNestedExceptions(List<Exception> exceps, boolean datastore) { if (exceps == null || exceps.isEmpty()) return; if (datastore && exceps.size() == 1) throw (RuntimeException) exceps.get(0); boolean fatal = false; Throwable[] t = exceps.toArray(new Throwable[exceps.size()]); for (int i = 0; i < t.length; i++) { if (t[i] instanceof OpenJPAException && ((OpenJPAException) t[i]).isFatal()) fatal = true; } OpenJPAException err; if (datastore) err = new StoreException(_loc.get("nested-exceps")); else err = new UserException(_loc.get("nested-exceps")); throw err.setNestedThrowables(t).setFatal(fatal); }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
new Throwable [errors.size()]); throw new InvalidStateException(_loc.get("tm-not-found")). setFatal(true).setNestedThrowables(t);
new Throwable [errors.size()]); throw new InvalidStateException(_loc.get("tm-not-found")). setFatal(true).setNestedThrowables(t);
new Throwable [errors.size()]); throw new InvalidStateException(_loc.get("tm-not-found")). setFatal(true).setNestedThrowables(t);
new Throwable [errors.size()]); throw new InvalidStateException(_loc.get("tm-not-found")). setFatal(true).setNestedThrowables(t);
new Throwable [errors.size()]); throw new InvalidStateException(_loc.get("tm-not-found")). setFatal(true).setNestedThrowables(t);