private static Throwable causeOf(Throwable ex) { if (ex instanceof JDOException) { final JDOException jdoException = (JDOException) ex; final Throwable[] nestedExceptions = jdoException.getNestedExceptions(); return nestedExceptions != null && nestedExceptions.length > 0? nestedExceptions[0]: null; } else { return ex.getCause(); } }
/** * Method to do a refresh of objects that failed verification in the * exception. * @param exc The JDO exception containing the objects that failed * @since 1.1 */ public synchronized void refreshAll(JDOException exc) { Object obj = exc.getFailedObject(); if (obj != null) { refresh(obj); } Throwable[] nested_excs = exc.getNestedExceptions(); if (nested_excs != null) { for (int i = 0; i < nested_excs.length; i++) { if (nested_excs[i] instanceof JDOException) { refreshAll((JDOException) nested_excs[i]); } } } }
/** * Method to do a refresh of objects that failed verification in the * exception. * @param exc The JDO exception containing the objects that failed */ public void refreshAll(JDOException exc) { Object obj = exc.getFailedObject(); if (obj != null) { refresh(obj); } Throwable[] nestedExceptions = exc.getNestedExceptions(); if (nestedExceptions != null) { for (Throwable nestedExc : nestedExceptions) { if (nestedExc instanceof JDOException) { refreshAll((JDOException) nestedExc); } } } }
@Override public void refreshAll(JDOException arg0) { DBTracer.logCall(this, arg0); checkOpen(); //We can't use HashSet because it may call an object's hashCode() and activateRead(). ObjectIdentitySet<Object> failed = new ObjectIdentitySet<>(); for (Throwable t: arg0.getNestedExceptions()) { Object f = ((JDOOptimisticVerificationException)t).getFailedObject(); failed.add(f); } nativeConnection.refreshAll(failed); }
if (jdoe.getNestedExceptions() != null) if (jdoe.getNestedExceptions() != null) if (jdoe.getNestedExceptions() != null) if (jdoe.getNestedExceptions() != null)
if (jdoe.getNestedExceptions() != null) if (jdoe.getNestedExceptions() != null) if (jdoe.getNestedExceptions() != null) if (jdoe.getNestedExceptions() != null)