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; } };
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; } };
/** * 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; }
this, false); if (isActive()) setRollbackOnly(ex); throw ex;
this, false); if (isActive()) setRollbackOnly(ex); throw ex;
this, false); if (isActive()) 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; }
this, false); if (isActive()) setRollbackOnly(ex); throw ex;