0 Replies Latest reply on Jul 5, 2006 4:15 AM by roberto roberto

    ejbFindByPrimaryKey behaviour...

    roberto roberto Novice

      I'm using EntityBean BMP. I'm running a sample code that performs the following steps:

      1. retrieve a particular instance of an EntityBean using the findByPrimaryKey method
      2. call the get method of an attribute on that retrieved object
      3. some instructions after I try to retrieve again the same EntityBean, so using the same primary key values as before

      Logging all the methods I found the following behaviour, corresponding to the previous points:

      1. call the findByPrimaryKey
      call the ejbFindByPrimaryKey
      2. call the ejbLoad
      call the get method of the desired attribute
      3. call again the ejbFindByPrimaryKey (EVEN IF Jboss has already previously loaded the requested EntityBean)

      No differences I found moving from JBoss 3.2.8 to the last 4.0.4.GA.

      Running the same code under Websphere, for instance, no ejbFindByPrimaryKey method is called when I perform the
      second retrieve of the object (the previous point 3).

      Is there a configurable property that avoid Jboss to run the ejbFindByPrimaryKey for the second time?
      Because the ejbFindByPrimaryKey method execute an unuseful Select SQL statement....

      Thank in advance