Hi!

Sowmya wrote:
> I am a newbie working in EJB. I have some basic clarifications to be made.
> We are using WebLogic Application Server(ver 4.0.3) to deploy the beans.
>
> This is with respect to bean-managed persistence
>
> I have read that ejbLoad() is called whenever any business method is
> invoked.

This is incorrect. ejbLoad is called "whenever the server needs to
resynch the state of the in-memory instance with the database", which
may not be whenever any business method is invoked. This is one of the
cases (id TX_REQUIRES_NEW is used, and some other conditions apply), but
there are lots more.

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.

> 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?

/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