0 Replies Latest reply on Aug 22, 2008 10:10 AM by liumin hu

    some newbie quesions about transaction.

    liumin hu Master

      hi everyone,

      I have some questions about transaction

      1 If the db(informix 7) does not support transaction, the session bean's TransactionAttribute must to be not_support?If not, it is required by default. i got a RollbackException.

      2 when I test the same method with DefautDS(hypersonic) of JBoss, if TransactionAttribute is not_support, i got exception below, Is it normal?


      Exception in thread "main" javax.persistence.TransactionRequiredException: EntityManager must be access within a transaction
       at org.jboss.ejb3.entity.ManagedEntityManagerFactory.verifyInTx(ManagedEntityManagerFactory.java:150)
       at org.jboss.ejb3.entity.TransactionScopedEntityManager.persist(TransactionScopedEntityManager.java:181)
      ......
      


      3 how can i use these 2 DataSources in one method? I created 2 EntityManager, but there is always an exception because of transaction.

      thanks in advance

      liu