Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

is creating InitialContext an expensive process?

807607Nov 8 2006 — edited Nov 8 2006
hi guys
i have a question about the initial context. you see, i need to look up several EJBs from different servers. so i need to set up correct URL in the context when i want to lookup EJBs that are deployed on that server, i also need to change the url to a different server in order to lookup other EJBs. so, is it logic to have seperate initialcontext initialized for each server url from the start, or create it as i need it along the way.
right now, what i did is in the servicelocator class, i have a lookupHome method that takes url, ejbName and class as parameters. so, it will check the cache to see if there is already a home object, if not, use the url to create a context and lookup with the ejbName. i don't know if this is very costly. thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 6 2006
Added on Nov 8 2006
4 comments
248 views