@Override public boolean isJoinedToTransaction() { return isActive() && _isJoinedToTransaction; }
@Override public boolean isJoinedToTransaction() { return isActive() && _isJoinedToTransaction; }
public boolean getRollbackOnly() { if (!isActive()) throw new IllegalStateException(_loc.get("no-transaction") .getMessage()); return _broker.getRollbackOnly(); }
public boolean getRollbackOnly() { if (!isActive()) throw new IllegalStateException(_loc.get("no-transaction") .getMessage()); return _broker.getRollbackOnly(); }
public Throwable getRollbackCause() { if (!isActive()) throw new IllegalStateException(_loc.get("no-transaction") .getMessage()); return _broker.getRollbackCause(); }
public Throwable getRollbackCause() { if (!isActive()) throw new IllegalStateException(_loc.get("no-transaction") .getMessage()); return _broker.getRollbackCause(); }
public boolean getRollbackOnly() { if (!isActive()) throw new IllegalStateException(_loc.get("no-transaction") .getMessage()); return _broker.getRollbackOnly(); }
public Throwable getRollbackCause() { if (!isActive()) throw new IllegalStateException(_loc.get("no-transaction") .getMessage()); return _broker.getRollbackCause(); }
public boolean getRollbackOnly() { if (!isActive()) throw new IllegalStateException(_loc.get("no-transaction") .getMessage()); return _broker.getRollbackOnly(); }
public Throwable getRollbackCause() { if (!isActive()) throw new IllegalStateException(_loc.get("no-transaction") .getMessage()); return _broker.getRollbackCause(); }
public boolean getRollbackOnly() { if (!isActive()) throw new IllegalStateException(_loc.get("no-transaction") .getMessage()); return _broker.getRollbackOnly(); }
public Throwable getRollbackCause() { if (!isActive()) throw new IllegalStateException(_loc.get("no-transaction") .getMessage()); return _broker.getRollbackCause(); }
public RuntimeException translate(RuntimeException re) { RuntimeException ex = toPersistenceException(re); if (!(ex instanceof NonUniqueResultException) && !(ex instanceof NoResultException) && !(ex instanceof LockTimeoutException) && !(ex instanceof QueryTimeoutException) && !throwing) { try { throwing = true; if (em.isOpen() && ((EntityManagerImpl) em).isActive()) ((EntityManagerImpl) em).setRollbackOnly(ex); } finally { // handle re-entrancy throwing = false; } } return ex; } };
public RuntimeException translate(RuntimeException re) { RuntimeException ex = toPersistenceException(re); if (!(ex instanceof NonUniqueResultException) && !(ex instanceof NoResultException) && !(ex instanceof LockTimeoutException) && !(ex instanceof QueryTimeoutException) && !throwing) { try { throwing = true; if (em.isOpen() && ((EntityManagerImpl) em).isActive()) ((EntityManagerImpl) em).setRollbackOnly(ex); } finally { // handle re-entrancy throwing = false; } } return ex; } };
public RuntimeException translate(RuntimeException re) { RuntimeException ex = toPersistenceException(re); if (!(ex instanceof NonUniqueResultException) && !(ex instanceof NoResultException) && !(ex instanceof LockTimeoutException) && !(ex instanceof QueryTimeoutException) && !throwing) { try { throwing = true; if (em.isOpen() && ((EntityManagerImpl) em).isActive()) ((EntityManagerImpl) em).setRollbackOnly(ex); } finally { // handle re-entrancy throwing = false; } } return ex; } };
public RuntimeException translate(RuntimeException re) { RuntimeException ex = toPersistenceException(re); if (!(ex instanceof NonUniqueResultException) && !(ex instanceof NoResultException) && !throwing) { try { throwing = true; if (em.isOpen() && ((EntityManagerImpl) em).isActive()) ((EntityManagerImpl) em).setRollbackOnly(re); } finally { // handle re-entrancy throwing = false; } } return ex; } };
public RuntimeException translate(RuntimeException re) { RuntimeException ex = toPersistenceException(re); if (!(ex instanceof NonUniqueResultException) && !(ex instanceof NoResultException) && !(ex instanceof LockTimeoutException) && !(ex instanceof QueryTimeoutException) && !throwing) { try { throwing = true; if (em.isOpen() && ((EntityManagerImpl) em).isActive()) ((EntityManagerImpl) em).setRollbackOnly(ex); } finally { // handle re-entrancy throwing = false; } } return ex; } };
/** * Unwraps this receiver to an instance of the given class, if possible. * * @exception if the given class is null, generic <code>Object.class</code> or a class * that is not wrapped by this receiver. * * @since 2.0.0 */ public <T> T unwrap(Class<T> cls) { Object[] delegates = new Object[]{_query.getInnermostDelegate(), _query.getDelegate(), _query, this}; for (Object o : delegates) { if (cls != null && cls != Object.class && cls.isInstance(o)) return (T)o; } // Set this transaction to rollback only (as per spec) here because the raised exception // does not go through normal exception translation pathways RuntimeException ex = new PersistenceException(_loc.get("unwrap-query-invalid", cls).toString(), null, this, false); if (_em.isActive()) _em.setRollbackOnly(ex); throw ex; }
/** * Unwraps this receiver to an instance of the given class, if possible. * * @exception if the given class is null, generic <code>Object.class</code> or a class * that is not wrapped by this receiver. * * @since 2.0.0 */ public <T> T unwrap(Class<T> cls) { Object[] delegates = new Object[]{_query.getInnermostDelegate(), _query.getDelegate(), _query, this}; for (Object o : delegates) { if (cls != null && cls != Object.class && cls.isInstance(o)) return (T)o; } // Set this transaction to rollback only (as per spec) here because the raised exception // does not go through normal exception translation pathways RuntimeException ex = new PersistenceException(_loc.get("unwrap-query-invalid", cls).toString(), null, this, false); if (_em.isActive()) _em.setRollbackOnly(ex); throw ex; }
/** * Unwraps this receiver to an instance of the given class, if possible. * * @exception if the given class is null, generic <code>Object.class</code> or a class * that is not wrapped by this receiver. * * @since 2.0.0 */ public <T> T unwrap(Class<T> cls) { Object[] delegates = new Object[]{_query.getInnermostDelegate(), _query.getDelegate(), _query, this}; for (Object o : delegates) { if (cls != null && cls != Object.class && cls.isInstance(o)) return (T)o; } // Set this transaction to rollback only (as per spec) here because the raised exception // does not go through normal exception translation pathways RuntimeException ex = new PersistenceException(_loc.get("unwrap-query-invalid", cls).toString(), null, this, false); if (_em.isActive()) _em.setRollbackOnly(ex); throw ex; }