0 Replies Latest reply on Apr 22, 2009 11:30 AM by sherkan777

    How to rollback tx in Seam JPA

    sherkan777

      Hi,
      Is this good approach to commit and roolback transaction after failure in Seam JPA on tomcat?



           public boolean authenticate() {
                boolean ret = false;
               try {
                    .....
                    getEM().getTransaction().commit();
                } catch(Exception e) {
                     identity.logout();
                     if (getEM().getTransaction().isActive())
                          getEM().getTransaction().setRollbackOnly();
                }
                return ret;
           }