final EntityManager em = emf.createEntityManager();
try {
final EntityTransaction transaction = em.getTransaction();
transaction.begin();
try {
final Person p = new Person();
p.setName("sirona");
em.persist(p);
transaction.commit();
} catch (final Exception e) {
transaction.rollback();