2 Replies Latest reply on Oct 10, 2008 5:49 AM by dro_k

    FlushModeType in Conversation

    nimo22

      When I use this:



      @Begin (flushMode = FlushModeType.MANUAL )
      public void call(Object o)
      {
      this.o= o;
      log.info("entityManager.isOpen() #0", entityManager.isOpen());
      log.info("entityManager.getFlushMode() #0", entityManager.getFlushMode());
      }




      then my console prints:


      07:50:53,749 INFO  entityManager.isOpen() true
      07:50:53,749 INFO  entityManager.getFlushMode() AUTO



      Even the flushMode is set to Manual!?


      When I use javax.persistence.FlushModeType instead of


      import org.jboss.seam.annotations.FlushModeType and set the FlushMode-Type in the code:


      entityManager.setFlushMode(FlushModeType.COMMIT);
      log.info("entityManager.getFlushMode() #0", entityManager.getFlushMode());



      then it prints



      07:50:53,749 INFO  entityManager.isOpen() true
      07:50:53,749 INFO  entityManager.getFlushMode() COMMIT



      A little confuse..!




        • 1. Re: FlushModeType in Conversation
          nickarls

          I assume the flushMode in the annotation is information for the interceptor and not necessarily true when viewed from within.

          • 2. Re: FlushModeType in Conversation
            dro_k

            JPA doesn't have a concept of Manual flushing. When you set the flush-mode to manual in Seam, seam basically sets the JPA flush mode to COMMIT (so the EntityManager doesn't flush automatically) and queues all the statements until you call flush.