pooling definitely does work for BMP.

couple of things i found that you might want to check off.

1. implement an isModified method

public boolean isModified() {
  return false;
 }

which orion will check to determine if ejbLoad needs to be called. we're
using the value object pattern to the above works for us. you may want to
make it more complicated depending on your requirements.

2.. return a Collection from your finder methods. returning an Enumeration
seems to cause orion to not pool.

3. if you have defined your own primary key instead of using, say, Integer,
it seems you need to implement equals() and hashCode().

if you can't get it working maybe post the code from one of your bean
classes.

good luck,
greg.


----- Original Message -----
From: "Geoff Soutter" <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Friday, January 11, 2002 8:08 AM
Subject: RE: Simple question re caching/pooling of BMP Entity Beans


> Hi Sergey,
>
> Thanks for the reply. I didn't explain it very clearly did I? What I
> meant was:
>
> "However, it appears that it goes to the database (i.e. calls _ejbLoad_
> in the Entity Bean's implementation) for every call to findByPrimaryKey,
> regardless of whether it has previously read the instance with the
> specified key before."
>
> Have you been able to get pooling of BMP entity beans working?
>
> Geoff
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]] On Behalf Of
> > Sergey G. Aslanov
> > Sent: Thursday, 10 January, 2002 6:29 PM
> > To: Orion-Interest
> > Subject: Re: Simple question re caching/pooling of BMP Entity Beans
> >
> >
> > Hi Geoff
> >
> > Loading of beans have these stages:
> > 1. calling ejbFindBy... to get the primKeys of the entities;
> > 2. checking if entities with such keys are already pooled;
> > 3. for every key checking: if not pooled - call ejbLoad, else
> > - get instance from pool;
> >
> > As you see, ejbFindBy... are called always independently of
> > entity is pooled or not.
> >
> > Thursday, January 10, 2002, 2:01:37 AM, you wrote:
> >
> > GS> Hi there,
> >
> > GS> I'm teaching myself how to use Orion and I've got a
> > simple question
> > GS> about caching/pooling of BMP Entity Bean instances.
> >
> > GS> I've created a simple app which lets me read a BMP Entity Bean
> > GS> through a Session Bean. I would expect that when I call
> > GS> findByPrimaryKey on my Entity Bean's home interface, Orion caches
> > GS> the instance it creates so that next time I call findByPrimaryKey
> > GS> for the same key, it just returns the instance it already
> > has rather
> > GS> than creating a new one. However, it appears that it goes to the
> > GS> database (i.e. calls ejbFindByPrimaryKey in the Entity Bean's
> > GS> implementation) for every call to findByPrimaryKey, regardless of
> > GS> whether it has previously read the instance with the
> > specified key
> > GS> before.
> >
> > GS> I checked the list archive and it appears that someone
> > has reported
> > GS> a similar problem a while back but there were no replies
> > GS>
> > (http://www.mail-archive.com/orion-interest@orionserver.com/ms
> g17359
> GS> .htm
> GS> l).
>
> GS> I also checked the documentation and for orion-ejb-jar.xml it states
>
> GS> that exclusive-write-access is true by default, and since I am not
> GS> setting it I presume it's defaulting to true which should allow
> GS> Orion to cache the entity beans.
>
> GS> So, can anyone shed any light on how whether/how I can get Orion to
> GS> cache BMP entity beans?
>
> GS> Cheers
>
> GS> Geoff
>
>
> --
> Sergey G. Aslanov,
> CBOSS Group,
> Web-technologies department
> mailto:[EMAIL PROTECTED]
> tel: +7 095 7555655
>
>
>


Reply via email to