2 Replies Latest reply on Jan 30, 2008 8:50 AM by Breako Beats

    Transaction recovery

    Breako Beats Newbie

      I am using SEAM Managed EntityManager with FushMode set to Manual for a JTA datasource.
      When I flush the EntityManager for some invalid update, I get a database exception.
      I catch this exception, the entity I am updating is still attached and I try to correct the invalid data and then try to reflush the update. However I can't persist the change even though this time it is valid. I get a javax.persistence.TransactionRequiredException: no transaction is in progress exception.
      I am wondering is there any way I can recover from transaction failure?
      My code is below.

      public void SeamPOJO {
       private EntityManager em;
       public String commit () {
       // Create entity
       Person person = new Person();
       // set invalid data
       try {
       } catch (Exception e) {
       // data is invalid correct it

      ~any advice, comments appreciated. Thanks