0 Replies Latest reply on Apr 1, 2004 8:57 PM by monowai

    EJB Returning the Wrong Bean

    monowai

      Jboss 3.2.4 rc1
      JDK 1.4.2

      I have 2 beans:
      The first (BeanA) contains a Collection of data and is an Entity Bean

      The second (BeanB also an EntityBean) is an aggregator of the Collections obtained from one or more BeanA's located by findByPrimaryKey

      Both beans have the "Supports" Transaction Attribute set

      The problem: When BeanB requests the Collection from BeanA, it get's a collection from an entiredly different Bean to that which was requested. It only seems to happen when I get a large number of BeanA's in memory (300+).

      It appears to me that the BeanA is being "given" (by the container i presume) a set of data that belongs to another bean.

      I have confirmed that BeanB is DEFINETLY requesting the correct keys (System.out statements along with writing values to the database)
      I also have verified that the BeanA's findByPrimaryKey method is returning a valid PrimaryKey class value. It is the wrong Remote Interface seems to be returned, because when I call the getCollection() method in BeanA, it returns data from a totally different bean. (A trace statement I have in BeanA tells me that a completly different bean's primary key is being accessed to that which if just EJBFound)

      It also appears that EJBLoad is not being called on BeanA when I call the getCollection() method if that offers any clues?

      This code has been working for years under WebLogic, but we have only just started testing in anger unser JBOSS.

      Suggestions anyone?