Hmm. Seems I am really getting myself confused. :-). I think I've got it
now... I'm mistaking the db call in ejbFindByPrimaryKey with the db call
in ejbLoad. Doh.

So, the first time I call findByPrimaryKey, Orion calls
ejbFindByPrimaryKey which goes to the database basically only to confirm
the row hasn't been deleted. Then Orion calls ejbLoad which goes the the
database again to load in the actual contents of the row. So, the row in
question is accessed twice. 

Then, the second time, Orion still calls findByPrimaryKey, but avoids
the ejbLoad. 

The thing is here, exclusive-write-access is set to true (by default),
so why is Orion bothering to call findByPrimaryKey? Can't it just keep
an internal primary key -> ejb map and return the ejb instance directly?
After all, if exclusive-write-access is on, the row can only be deleted
by Orion itself...

Geoff


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]] On Behalf Of 
> Geoff Soutter
> Sent: Friday, 11 January, 2002 9:09 AM
> To: Orion-Interest
> 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