Hi!

Sowmya wrote:
> > To know exactly when this happens is less than trivial. Lots of "if
> > this" scenarios to consider. But generally ejbLoad will be called for
> > example upon start of each transaction.
>
> I should have some way of controlling the number of database calls
> that the bean will make. Else I'll end up with a lot of unnecessary
> database calls resulting in increased n/w traffic.

Indeed, and competent EJB containers will let you tweak this to suit
your particular needs. It's just not very specified in the EJB
specification when ejbLoad should be called, which is the way it should
be IMHO.

> > > But it is also called by the container when I do a
> > > findByPrimaryKey. I'm not very clear as to when all ejbLoad() is called.
> >
> > WLS should not call ejbLoad upon findByPrimaryKey, BUT both ejbLoad and
> > ejbFindByPrimaryKey use a helper method called refresh(). It might be
> > that method that is called. Are you 100% sure that it is ejbLoad and not
> > refresh() that is called?
>
> Yes, I am aware of the refresh() method. I am 100% sure that the ejbLoad()
> is first called ( which in turn calls refresh() ) when
> ejbFindByPrimaryKey() is called. So, if ejbFindByPrimaryKey is going to
> call ejbLoad() ( and in turn refresh() ) then why should I call refresh()
> in the ejbFindByPrimaryKey() method also?
>
> Hope u'll  help me further on this issue.

Well, I do know that the default *CMP* implementation in WLS 4.5 calls
ejbLoad (as a consequence of automatic activation of found objects).
This will most likely change in 5.0 due to a timely intervention by
*cough* yours truly *cough*, as this has some rather nasty side
effects... (cascading activations to be precise, in case of
findByPrimaryKey calls in ejbLoad).

But I don't think that BMP is affected by this "design decision". Only
CMP, AFAIK. Have you contacted support@weblogic about it? You should.

/Rickard

--
Rickard �berg

@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to