0 Replies Latest reply on Jul 9, 2007 10:03 AM by fobos

    JPA in database with no transaction support

    fobos

      Hi all, i have a mapped Entity JPA tables to database with no transaction support and when a have a SSB with eg:

      List method x(){
      1- x = em.persist(obj);
      2- y = em.find(obj.class,key);
      3- z = em.createNamedQuery(queryXX).getResultList();
      System.out.println(x+y+z);// at this line all ok
      return z;
      }


      the lines 1,2,3 and 4 run perfect print objects in console, but when in a Backing Bean for JSF i access this SSB and call this method throws the folowing exception:

      java.lang.RuntimeException: javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state
      org.jboss.aspects.tx.TxPolicy.handleEndTransactionException(TxPolicy.java:198)


      The problem is in a SSB ? JPA Implementation ? JSF ?

      The registry in line "1- x = em.persist(obj);" is persisted in database and some operations is ok print in console, but when a return a object to JSF backing bean the error is throw.

      JPA works with databases can´t work with transactions ??

      Please helps, i using a Informix database with no transaction support.
      Thanks.