Hi

I have the folowing code in all the business methods of a stateless session bean:

initialContext = new InitialContext();
dataSource = (DataSource)initialContext.lookup ("java:comp/env/jdbc/AccountDB");

I was thinking of 2 alternatives to optimize the performance:

1) executing this code only once (the first time ever that a business method is 
called, for example) and saving the dataSource reference in a static member of some 
class of my bean.

2) executing this code in ejbCreate() and saving a reference of a dataSource object 
for each bean instance. With this solution, I would save a lot less CPU time than with 
the previous solution, though.

I can't find anything in the EJB spec about it.
Which solution would you choose?
Would you try to optimise this at all?

Claude

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