List of usage examples for javax.persistence EntityTransaction getRollbackOnly
public boolean getRollbackOnly();
From source file:test.unit.be.fedict.eid.applet.beta.PersistenceTest.java
@After public void tearDown() throws Exception { EntityTransaction entityTransaction = this.entityManager.getTransaction(); LOG.debug("entity manager open: " + this.entityManager.isOpen()); LOG.debug("entity transaction active: " + entityTransaction.isActive()); if (entityTransaction.isActive()) { if (entityTransaction.getRollbackOnly()) { entityTransaction.rollback(); } else {/* w ww. jav a 2s.c o m*/ entityTransaction.commit(); } } this.entityManager.close(); }