As a result of some transaction problems with JPA, I am managing some of these manually, following a standard like:
EntityTransaction txn = em.getTransaction();
txn.begin();
try {
em.persist(myentity);
txn.commit();
}
finally {
if (txn.isActive())
txn.rollback();
}
While others are managed directly from entitymanager using autocommit (set in my framework):
em.persist(myentity);
What are the problems using this approach?