1 Reply Latest reply on Mar 21, 2003 11:08 AM by Peter Doornbosch

    EJB life-cycle problem

    Manuel Newbie


      I have a little problem, I been working in some Entity Beans based on the template that you give with JBoss.

      The first time I call 'findByPrimaryKey()' the next callback begin
      'setEntityContext()'
      'ejbFindByPrimaryKey()'

      Then I call 'getValues()' and the next
      callbacks begin
      'setEntityContext()'
      'ejbActivate()'
      'ejbLoad()'

      Now, the next time I call (in a different program) 'findByPrimaryKey' I got the next callbacks
      'setEntityContext()'

      And when I call 'getValues()' I got the callback
      'setEntityContext()'

      The PROBLEM is that ejbLoad is not called again and if I update my table with an SQL sentence from a different source the EntityBean keeps the same data, it is not refreshed, even I can delete the row and the entity bean doesn't see the change. Which could be my problem?

      Thanks !!

        • 1. Re: EJB life-cycle problem
          Peter Doornbosch Apprentice

          commit option A
          The standard JBoss configuration uses commit option A for standard entity beans. This assumes total control of the data. You need option B (or C, or D ;-). Check any EJB documentation or the JBoss docs to determine which option you want, and than change it in de standardjboss.xml or create a new container configuration based on an existing one and use that for your beans.

          Cheers,
          Peter.