1 Reply Latest reply on Aug 6, 2002 1:42 PM by dsundstrom

    ejbStore called after findByPrimaryKey

    maku01

      Hi!

      I'm working with JBoss 3.0 and CMP.

      Why is ejbStore called twice after a
      simple findByPrimaryKey?

      Please, can anybody explain it??
      TIA

      Martin

        • 1. Re: ejbStore called after findByPrimaryKey
          dsundstrom

          It is called before findByPrimaryKey because the ejb specification requires a full synchronization before executing a finder, and it is called after because you may have modified your object between the finder and the end of your code.

          You may have modified a local variable in the findByPrimaryKey and then in ejbStore you could store that variable in a persistenct field.

          Don't worry about optimizing away the ejbStore methods. They normaly don't do anything so HotSpot just wipes them out. In the JBossCMP implemnentation I assure that all of the callbacks are respected, so users don't get wierd states.

          If you run a profiler and prove that this method is really an serious preformance hit to the server, I consider an optimization.