Package org.hibernate

Examples of org.hibernate.Transaction.wasRolledBack()


 
  public static void rollbackTransaction() {
    Transaction tx = (Transaction) threadTransaction.get();
    try {
      threadTransaction.set(null);
      if ( tx != null && !tx.wasCommitted() && !tx.wasRolledBack() ) {
        tx.rollback();
      }
    } catch (HibernateException e) {
      logger.error("Exception " + e.getMessage(), e);
      throw new PersistException(e);
View Full Code Here


   
    public static void commit() throws HibernateException {
        Transaction t = TRANSACTION.get();
        TRANSACTION.set(null);
        try {
            if (t != null && !t.wasCommitted() && !t.wasRolledBack()) {
                t.commit();
            }
        } catch (HibernateException e) {
            t.rollback();
            throw e;
View Full Code Here

   
    public static void rollback() throws HibernateException {
        Transaction t = TRANSACTION.get();
        TRANSACTION.set(null);
       
        if (t != null && !t.wasCommitted() && !t.wasRolledBack()) {
            t.rollback();
        }
    }

    @SuppressWarnings("unchecked")
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.