1 Reply Latest reply on May 23, 2007 3:52 AM by dazhu tang

    How to update the DataModel object?

    dazhu tang Newbie

      I am using seam 1.2.0 and integrate it with Ajax4Jsf in the project.

      My question is when i modified calculation from 1 to 2 in the page , i need to modify the paramters list (Annotated by DataModel) by ajax request.
      my codes are as follows:

      @DataModel
      private List runParameters;

      @Begin(join = true)
      @Factory("runParameters")
      public void findRunParameters() throws ClassNotFoundException {

      ....some codes to get the runParameters list through hibernate3
      }

      the action will be called by ajax is:

      public void changeDropdownForCalculation(ActionEvent event) throws Exception {
      ......
      findRunParameters();

      }

      now you can see that i am using findRunParameters() to modify the list directly , but but i got the exception as follows:

      Caused by: org.hibernate.HibernateException: identifier of an instance of com.ogentech.cpi.dataobjects.calculation.Calculation was altered from 1 to 2

      Can someone help me?

        • 1. Re: How to update the DataModel object?
          dazhu tang Newbie

          i debug the memory and note that in ajax requests , the hibernate session is the same .my configuration about hibernate session in component.xml is:

          <core:managed-hibernate-session name="session" auto-create="true"
          session-factory-jndi-name="java:/HibernateSessionFactory" />


          and in the hibernate.cfg.xml i have added the properties according the seam manual:
          true
          after_statement
          org.hibernate.transaction.JBossTransactionManagerLookup
          org.hibernate.transaction.JTATransactionFactory