0 Replies Latest reply on Jun 28, 2013 8:22 AM by kai_m.

    Problem with flush mode=manual and ElementCollection

    kai_m.

      Hello,

       

      we use Seam2.3 with Tomcat and Hibernate.

       

      in our project we've had problems avoiding an automatic flush when adding an element to an @ElementCollection in an entity.

      In our page.xml we have:

      {code:xml}<begin-conversation flush-mode="MANUAL" join="true"/>{code}

      Then we added {code}@Begin(flushMode=FlushMode.MANUAL, join=true){code} to the method we call via ajax.

       

      Hibernate puts the elements in a PersistentBag. New elements where automatically flushed when inserted.

       

      Then we added default-flush-mode="MANUAL" to core:manager in components.xml.

      After that there was no auto-flush when adding new elements, but now the EntityManager doesn't persist the new element in the collection. It doesn't seem to notice that the  entity is dirty.

      We tried calling em.merge(.), but that didn't work.

       

      Can anyone help?

      Thanks...