2 Replies Latest reply on Oct 5, 2006 7:51 AM by christophe.laumond

    automatic persitence on RENDER_RESPONSE

    christophe.laumond

      Hi,

      I have something like

      @Entity
      public class Question implements java.io.Serializable {
      
      @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "question")
       public Set<Answer> getAnswers() {
       return this.answers;
       }
      


      Before rendering I add Answer instance to the above Set but I don't want to persist them, I just need them in order to retrieve value fromt the UI and according to the value i will persist some of them and discard some others.

      But on the render response event I got the following stacktrace :


      2006-09-28 14:07:53,984 DEBUG [org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener] committing transaction after phase: RENDER_RESPONSE(6)
      2006-09-28 14:07:53,984 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      2006-09-28 14:07:53,984 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] processing flush-time cascades


      and all the Answer instances are persisted !

      It looks like method like save() or update() are called automatically during this phase.

      I would like to prevent this and understand why this happens.

      Is this related to my faces-config file lifcycle tag :


      <lifecycle>
      <phase-listener>org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener</phase-listener>
      </lifecycle>


      thanks in advance for your feedback

      Regards,
      Christophe