13 Replies Latest reply on Apr 23, 2009 6:24 PM by Arbi Sookazian

    Set flushMode over @Begin(flushMode=MANUAL) doesn't work but session.setFlushMode(MANUAL) does

    Thierry Rietsch Newbie

      Hi


      I have a problem with the flushMode on a conversation.
      If I set the flushMode to manual in the @Begin(..) annotation, Hibernate still populates any changes on the attached entity directly to the database (as if the flushMode would be set to auto). If I take a look at the persistence context in the conversation on the seam debug page, the flushMode is set to manual. So theoretically it should work.



      - Component (org.jboss.seam.persistence.persistenceContexts)
      class   class org.jboss.seam.persistence.PersistenceContexts
      flushMode       MANUAL
      touchedContexts []
      toString()      org.jboss.seam.persistence.PersistenceContexts@49005""
      




      But if I set the flushMode with hibernate (Session session = (Session) em.getDelegate(); session.setFlushMode(FlushMode.MANUAL);) the behaviour is as expected and hibernate doesn't automatically flushes the changes to the entity into the database.


      Do I have to configure some additional settings (e.g. in the components.xml) that the seam flushMode get set on the hibernate session?