Package javax.persistence

Examples of javax.persistence.EntityTransaction.rollback()


        tx.begin();
        Object result = action.execute(method, parameters);
        tx.commit();
        return result;
      } catch (Exception e) {
        tx.rollback();
        throw e.getCause();
      }
    }
  }
 
View Full Code Here


        transaction.commit();
      }
    } catch (Exception e) {
      //回滚当前事务
      if(type != TransactionalType.READOLNY && transaction.isActive()){
        transaction.rollback();
      }
      throw e;
    }
   
    log.debug("[JpaLocalTransactionInterceptor]离开=》"+methodInvocation.getMethod().getName());
View Full Code Here

      }
    } catch (Exception e) {
      if(hbTS != null)
        hbTS.rollback();
      if(jpaTS != null)
        jpaTS.rollback();
      throw e;
    }
    return result;
  }
}
View Full Code Here

    flv.setDeleted("false");
    try {
      flv = getEntityManager().merge(flv);
      tx.commit();
    } catch (Exception e) {
      tx.rollback();
      throw new Exception(e.getMessage());
    }

    tx.begin();
    Fieldvalues fl = new Fieldvalues();
View Full Code Here

    fl.setDeleted("false");
    try {
      getEntityManager().merge(fl);
      tx.commit();
    } catch (Exception e) {
      tx.rollback();
      throw new Exception(e.getMessage());
    }

  }
View Full Code Here

    conf.setConf_value("value1");
    try {
      conf = getEntityManager().merge(conf);
      tx.commit();
    } catch (Exception e) {
      tx.rollback();
      throw new Exception(e.getMessage());
    }
   
    result = q.getResultList();
    assertTrue("result should not be empty", result.size()>0);
View Full Code Here

    try {
      conf = getEntityManager().find(Configuration.class, id);
      getEntityManager().remove(conf);
      tx.commit();
    } catch (Exception e) {
      tx.rollback();
      throw new Exception(e.getMessage());
    }
    result = q.getResultList();
    assertTrue("result should be empty", result.size() == 0);
  }
View Full Code Here

    tx.begin();
    try {
      getEntityManager().merge(eValue);
      tx.commit();
    } catch (Exception e) {
      tx.rollback();
      throw new Exception(e.getMessage());
    }
  }
}
View Full Code Here

    tx.begin();
    try {
      getEntityManager().merge(sl);
      tx.commit();
    } catch (Exception e) {
      tx.rollback();
      throw new Exception(e.getMessage());
    }
   
  }
 
View Full Code Here

    fl.setDeleted("false");
    try {
      getEntityManager().merge(fl);
      tx.commit();
    } catch (Exception e) {
      tx.rollback();
      throw new Exception(e.getMessage());
    }
  }
}
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.