/** * Throw the proper exception based on the given set of flush errors, or * do nothing if no errors occurred. */ private OpenJPAException newFlushException(Collection exceps) { if (exceps == null || exceps.isEmpty()) return null; Throwable[] t = (Throwable[]) exceps.toArray (new Throwable[exceps.size()]); List failed = new ArrayList(t.length); // create fatal exception with nested exceptions for all the failed // objects; if all OL exceptions, throw a top-level OL exception boolean opt = true; for (int i = 0; opt && i < t.length; i++) { opt = t[i] instanceof OptimisticException; if (opt) { Object f = ((OptimisticException) t[i]).getFailedObject(); if (f != null) failed.add(f); } } if (opt && !failed.isEmpty()) return new OptimisticException(failed, t); if (opt) return new OptimisticException(t); return new StoreException(_loc.get("rolled-back")). setNestedThrowables(t).setFatal(true); }
opt = t[i] instanceof OptimisticException; if (opt) { Object f = ((OptimisticException) t[i]).getFailedObject(); if (f != null) failed.add(f);
opt = t[i] instanceof OptimisticException; if (opt) { Object f = ((OptimisticException) t[i]).getFailedObject(); if (f != null) failed.add(f);
opt = t[i] instanceof OptimisticException; if (opt) { Object f = ((OptimisticException) t[i]).getFailedObject(); if (f != null) failed.add(f);
opt = t[i] instanceof OptimisticException; if (opt) { Object f = ((OptimisticException) t[i]).getFailedObject(); if (f != null) failed.add(f);
Object o = e.getFailedObject(); OpenJPAStateManager sm = _ctx.getStateManager(o); if (sm == null)
Object o = e.getFailedObject(); OpenJPAStateManager sm = _ctx.getStateManager(o); if (sm == null)
Object o = e.getFailedObject(); OpenJPAStateManager sm = _ctx.getStateManager(o); if (sm == null)
Object o = e.getFailedObject(); OpenJPAStateManager sm = _ctx.getStateManager(o); if (sm == null)
Object o = e.getFailedObject(); OpenJPAStateManager sm = _ctx.getStateManager(o); if (sm == null)