1 Reply Latest reply on Feb 4, 2008 6:42 AM by Georges Berscheid

    dangerous transaction

    Dave Chen Master

      I use JBoss 4.0.5 GA. JSF web application

      create a thread local userTransaction

      userTransaction.begin() // in JSF before invoke application phase

      em.persist(entity1) //create entity in session bean using entity manager
      ...
      do something that throw exception
      cought the exception and indicate the transaction need to rollback

      userTransaction.rollback() // in JSF after invoke application phase

      but entity1 is created in database.

      I debugged the code, the rollback was called.

      Thanks for help.
      Dave