Hello Dapeng,
Its good idea to create the InitialContext only once than every time as and
when required. I feel it is best to create in ejbCreate() function,
rather than in setEntityContext() as the setEntityContext() is called on a
bean instance every time the bean is moved in-out of a free pool. Hence,
best place will be ejbCreate(), which is called only once. Any comments from
others !! (This is true in Weblogic4.51 , check it for other server
implementation!!)
Thank you,
Regards.
Ganapur Srinivas.
Cognizant Technology Solutions India Ltd.
Ground Floor,
Deepak Complex,
National Games Road,
Opp.Pune Golf Course,
Yerwada.
Pune 411006.India.
Tel. :6691960.Extn-2277.
[EMAIL PROTECTED]
Hi,
in many EJB samples I have seen that people create the InitialContext and do
the lookup on each request. I just wonder whether it is necessary or can I
just do it once at the bean level in ejbCreate or setEntityContext to
improve the performance? If I can do it only once per bean, where shall I do
the initilization for the different beans? session beans in ejbCreate and
entity beans in setEntityContext?
I appreciate your help.
cheers
Dapeng Wang
===========================================================================
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".
===========================================================================
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".