public void printStackTrace() { printStackTrace(System.err); }
public void commit() { try { _broker.commit(); } catch (RollbackException e) { throw e; } catch (IllegalStateException e) { throw e; } catch (Exception e) { // Per JPA 2.0 spec, if the exception was due to a JSR-303 // constraint violation, the ConstraintViolationException should be // thrown. Since JSR-303 is optional, the cast to RuntimeException // prevents the introduction of a runtime dependency on the BV API. if (ValidationUtils.isConstraintViolationException(e)) throw (RuntimeException)e; // RollbackExceptions are special and aren't handled by the // normal exception translator, since the spec says they // should be thrown whenever the commit fails for any reason at // all, wheras the exception translator handles exceptions that // are caused for specific reasons // pass along the failed object if one is available. Object failedObject = null; if (e instanceof ExceptionInfo){ failedObject = ((ExceptionInfo)e).getFailedObject(); } throw new RollbackException(e).setFailedObject(failedObject); } }
public void commit() { try { _broker.commit(); } catch (RollbackException e) { throw e; } catch (IllegalStateException e) { throw e; } catch (Exception e) { // RollbackExceptions are special and aren't handled by the // normal exception translator, since the spec says they // should be thrown whenever the commit fails for any reason at // all, wheras the exception translator handles exceptions that // are caused for specific reasons throw new RollbackException(e); } }
/** * Persist and try to commit a pending {@link javax.persistence.Entity} instance, that is, one that was part of a failing * {@link EntityTransaction#commit()} call * @param pendingEntity the pending {@link javax.persistence.Entity} instance */ void persistAndTryCommit(final E pendingEntity) { try { currentTransaction.begin(); entityManager.persist(pendingEntity); currentTransaction.commit(); totalPersistedCount++; } catch (final RollbackException re) { if (verbose) { System.err.println(String.format("Cannot persist entity, skipping. [re.failedObject=%s]", re.getFailedObject())); } totalSkippedCount++; } }
log.warn("Cannot commit current transaction. [e.message={0}]", e.getMessage());
public void commit() { try { _broker.commit(); } catch (RollbackException e) { throw e; } catch (IllegalStateException e) { throw e; } catch (Exception e) { // Per JPA 2.0 spec, if the exception was due to a JSR-303 // constraint violation, the ConstraintViolationException should be // thrown. Since JSR-303 is optional, the cast to RuntimeException // prevents the introduction of a runtime dependency on the BV API. if (ValidationUtils.isConstraintViolationException(e)) throw (RuntimeException)e; // RollbackExceptions are special and aren't handled by the // normal exception translator, since the spec says they // should be thrown whenever the commit fails for any reason at // all, wheras the exception translator handles exceptions that // are caused for specific reasons // pass along the failed object if one is available. Object failedObject = null; if (e instanceof ExceptionInfo){ failedObject = ((ExceptionInfo)e).getFailedObject(); } throw new RollbackException(e).setFailedObject(failedObject); } }
public void commit() { try { _broker.commit(); } catch (RollbackException e) { throw e; } catch (IllegalStateException e) { throw e; } catch (Exception e) { // Per JPA 2.0 spec, if the exception was due to a JSR-303 // constraint violation, the ConstraintViolationException should be // thrown. Since JSR-303 is optional, the cast to RuntimeException // prevents the introduction of a runtime dependency on the BV API. if (ValidationUtils.isConstraintViolationException(e)) throw (RuntimeException)e; // RollbackExceptions are special and aren't handled by the // normal exception translator, since the spec says they // should be thrown whenever the commit fails for any reason at // all, wheras the exception translator handles exceptions that // are caused for specific reasons // pass along the failed object if one is available. Object failedObject = null; if (e instanceof ExceptionInfo){ failedObject = ((ExceptionInfo)e).getFailedObject(); } throw new RollbackException(e).setFailedObject(failedObject); } }
public void printStackTrace() { printStackTrace(System.err); }
public void commit() { try { _broker.commit(); } catch (RollbackException e) { throw e; } catch (IllegalStateException e) { throw e; } catch (Exception e) { // Per JPA 2.0 spec, if the exception was due to a JSR-303 // constraint violation, the ConstraintViolationException should be // thrown. Since JSR-303 is optional, the cast to RuntimeException // prevents the introduction of a runtime dependency on the BV API. if (ValidationUtils.isConstraintViolationException(e)) throw (RuntimeException)e; // RollbackExceptions are special and aren't handled by the // normal exception translator, since the spec says they // should be thrown whenever the commit fails for any reason at // all, wheras the exception translator handles exceptions that // are caused for specific reasons // pass along the failed object if one is available. Object failedObject = null; if (e instanceof ExceptionInfo){ failedObject = ((ExceptionInfo)e).getFailedObject(); } throw new RollbackException(e).setFailedObject(failedObject); } }
public void printStackTrace() { printStackTrace(System.err); }
public void printStackTrace() { printStackTrace(System.err); }
public void printStackTrace() { printStackTrace(System.err); }