0 Replies Latest reply on Jun 13, 2012 3:01 AM by nag007

    FlushMode does n't Work

    nag007

      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

       

       

      sample code:

       

         CustomerBranch is Entity....

         private List<CustomerBranch> custBranchesList= new ArrayList<CustomerBranch>();

         

       

      @Begin(flushMode=FlushModeType.MANUAL,join = true)

          public void populateSelectedList() throws Exception {

              PersistenceProvider.instance().setFlushModeManual(getEntityManager());

       

              ((Session)getEntityManager().getDelegate()).setFlushMode(FlushMode.MANUAL);

       

       

              custBranchesList.clear();

              custBranchesList.addAll(branchesMap.get(selectedBranch.toLowerCase()).getCustomerBranchs());

       

             }

          

            above method I add list to custBranchesList here I cant use any persist  still directly change reflect to the database

       

        this is my sample.xhtml page:

       

      component.xml

       

      <core:manager concurrent-request-timeout="2000"

        conversation-id-parameter="cid" conversation-timeout="120000" parent-conversation-id-parameter="pid"/>

      <web:hot-deploy-filter url-pattern="/*.mobee"/>

       

      <persistence:entity-manager-factory installed="@seamBootstrapsPu@"

        name="entityManagerFactory" persistence-unit-name="mobeeadmin"/>

      <persistence:managed-persistence-context auto-create="true"

        entity-manager-factory="@seamEmfRef@" name="entityManager" persistence-unit-jndi-name="@puJndiName

      @"/>

       

      pages.xml

       

      <page view-id="/pages/sample.xhtml">

       

              <begin-conversation flush-mode="manual" join="true" />

       

         </page>

      Message was edited by: nag peddu