• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can I perform JNDI namespace lookup across EJB containers?

 
Victor Su
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have read the following section online and I just can't figure out what it means:
Does it mean it is possible to perform the EJB look up across different EJB containers? According to the following scenario:
"...You should be using the EJB-ref mechanism to hook your EJBs together. You can use direct JNDI names but this is inflexible and does not leave any room for the Container to optimize access to collocated beans. For example, say you have a deployment where beans A and B are both replicated in two different containers, for performance and/or availability reasons. Clearly, you want every instance of A in container one to use instances of B also in container one. Likewise for container two. An EJB container can enforce this locality constraint using ejb-links, but not always using direct JNDI names... "
Thanks for your help!!
Victor
 
Victor Su
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I just fogot to ask the following question regarding to the topic I last made:
If we can perform the JNDI name look for the EJB with the same JNDI name living in different EJB containers, how to achieve that?
Thanks !
Victor
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18100
51
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JNDI is provided via a server. So you have to address the JNDI server (host and port address) that's associated with the container you're interested in.
 
Victor Su
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Holloway:
JNDI is provided via a server. So you have to address the JNDI server (host and port address) that's associated with the container you're interested in.

Hi, Tim,
Thanks very much for your reply! I am actually working on the project in a bank in migrating stuff from IBM's Websphere 3 to the new WAS 4 platform. Though the JNDI name look up is not the big issue in this mirgration, IBM will provide the support for distributed JNDI name look up in its latest WAS 5.0 environment. Therefore, I raised the question in the JavaRanch.
However, I just want to ask the further question, if you've got the time:
In this case, we've got two EJB A and B (with the same JNDI name) deployed and living in two different EJB containers
How to make the JNDI server to associate with the specific container for EJB A and B? How can the JNDI server know which EJB is being called (for example the Workload Manager to balance traffics to those two EJBs).
I am pretty a greenhorn in this issue and it would be of much appreciated if you could point me to a site or document to explain the issue in more details.
Thanks very much for your help!

Victor
 
Kiran Kumar
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
whileu create the initial context for the server which is providing the jndi service u can specify the provider url of the server with the ejb container u r interested in. so with the initial context created for the specified server when u lookup and request a bean the server will return u the home interface of the bean through object serialization.
hope this helps.
pl try ibm redbooks for detailed explaination or the www.webspherepro.com for a tutorial based explaination of the websphere server since u r working on websphere and more interested in websphere.
 
Victor Su
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Kiran,
Thanks very much for your message!
However, could you give me the further details of the following:
How to specify the provider url of the server with the specific ejb container? Note that in this scenario: we've got two EJBs with the same JNDI names sitting in two different EJB containers in the same application server. could you me give an example?
Following is the extract of your reply:"...
whileu create the initial context for the server which is providing the jndi service u can specify the provider url of the server with the ejb container u r interested in..."
Thanks!
Victor
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic