Package javax.persistence

Examples of javax.persistence.EntityTransaction.rollback()


                                {
                                    transaction.commit();
                                }
                                else
                                {
                                    transaction.rollback();
                                }
                            }
                            catch (Exception e)
                            {
                                firstException = e;
View Full Code Here


                                try
                                {
                                    // last chance to check it (again)
                                    if (commitFailed || transaction.getRollbackOnly())
                                    {
                                        transaction.rollback();
                                    }
                                    else
                                    {
                                        transaction.commit();
                                    }
View Full Code Here

            EntityTransaction transaction = getTransaction(currentEntityManagerEntry);
            if (transaction != null && transaction.isActive())
            {
                try
                {
                    transaction.rollback();
                }
                catch (Exception eRollback)
                {
                    if (LOGGER.isLoggable(Level.SEVERE))
                    {
View Full Code Here

      query.executeUpdate();

      txn.commit();
    } catch (Exception e) {
      if (txn != null && txn.isActive())
        txn.rollback();
      throw new CacheLoaderException("Exception caught in clear()", e);
    } finally {
      em.close();
    }
View Full Code Here

      }

      txn.commit();
    } catch (InterruptedException e) {
      if (txn != null && txn.isActive())
        txn.rollback();

      Thread.currentThread().interrupt();
    } catch (Exception e) {
      if (txn != null && txn.isActive())
        txn.rollback();
View Full Code Here

        txn.rollback();

      Thread.currentThread().interrupt();
    } catch (Exception e) {
      if (txn != null && txn.isActive())
        txn.rollback();

      throw new CacheLoaderException(e);
    } finally {
      em.close();
    }
View Full Code Here

        txn.commit();

        return true;
      } catch (Exception e) {
        if (txn != null && txn.isActive())
          txn.rollback();
        throw new CacheLoaderException(
            "Exception caught in removeLockSafe()", e);
      }
    } finally {
      em.close();
View Full Code Here

          em.merge(o);

          txn.commit();
        } catch (Exception e) {
          if (txn != null && txn.isActive())
            txn.rollback();
          throw new CacheLoaderException(
              "Exception caught in store()", e);
        }
      }
    } finally {
View Full Code Here

      account.getReportingPolicies().remove(reportingPolicy);
      entityManager.remove(reportingPolicy);
      transaction.commit();
    } finally {
      if (transaction.isActive()) {
        transaction.rollback();
      }
    }
  }

}
View Full Code Here

      entityManager.persist(newTest);
      transaction.commit();
      return newTest;
    } finally {
      if (transaction.isActive()) {
        transaction.rollback();
      }
    }
  }

  public UnverifiedAccount createUnverifiedAccount(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.