Transaction tx = em.getTransaction(); tx.begin(); try { update1(); update2(); } catch(Exception e) { failed = true } finally { if( !failed ) tx.commit(); else tx.rollbacl(); }
Transaction tx = em.getTransaction(); tx.begin(); try { update1(); update2(); } catch(Exception e) { failed = true } finally { if( !failed ) tx.commit(); else tx.rollbacl(); }