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

    How to rollback tx in Seam JPA

    Gregory Nikle Apprentice

      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;
           }