-
1. Re: Reference EJB Components
jonlee Nov 1, 2003 2:13 AM (in response to kkaal)Rather than do that, is it not possible to store your data in the session? This would save the extra cost of doing the lookup and retrieval.
You could also build an object cache bound to JNDI, look up the cache and obtain the data with the appropriate hash key (or whatever the key you use). You need to take the care to ensure that the right user picks up the data. So the session storage is still probably the best solution.
Hope that helps. -
2. Re: Reference EJB Components
kkaal Nov 1, 2003 9:21 AM (in response to kkaal)Thanks JonLee,
good hint, but I do NOT want to have the client transport the data. I would like my EJB have know each other, because my problem is a bit more complex than the described abstracted one. And: I want to have a liteweight client with simple interface to EJB.
There must be a way for the EJB in the container to contact each other directly.
thnaks for further help
Klaus -
3. Re: Reference EJB Components
juha Nov 1, 2003 10:36 AM (in response to kkaal)What exactly is the problem with using normal EJB semantics with bean lookups from the naming service?
-- Juha -
4. Re: Reference EJB Components
kkaal Nov 1, 2003 2:12 PM (in response to kkaal)My straight question: How do I store the reference of an EXISTING instance or an EJB in JNDI for allowing other EJB to find and access this INSTANCE? I would care for an unique name of the instance in JNDI.
Thanks for your help
Klaus -
5. Re: Reference EJB Components
juha Nov 1, 2003 2:22 PM (in response to kkaal)See the spec for <ejb-ref> elements.
Or pass the proxy as an argument to your method.
-- Juha -
6. Re: Reference EJB Components
kkaal Nov 2, 2003 4:53 AM (in response to kkaal)So, in essence, is it allowed for an EJB instance (object) to bind itself to a JNDI context by optaining the own handle and bind it to a unique identifier in a subcontext of JNDI? Like
(111 would be unique user-id)
java:ejb/myapp/111/usermanager
My other bean would know the user-id and could find the handle of the adjacent usermanger -
7. Re: Reference EJB Components
juha Nov 2, 2003 8:28 AM (in response to kkaal)It would work with an entity bean that has a shared identity. It does not make any sense to do so however, since the home proxy with the finders is already bound to JNDI.
It makes no sense for stateless session beans as there is no identity associated with the instance. Any one you get via the home proxy via JNDI would work.
Stateful session beans are restricted by the spec to only allow single client to access them. No concurrent access is allowed so it makes little sense to share the proxy in a global naming space like JNDI.
From the sound of things, what you're attempting to do seems to me there's something fundamentally flawed with the applications architecture.
-- Juha -
8. Re: Reference EJB Components
kkaal Nov 2, 2003 1:52 PM (in response to kkaal)Juha, thanxs for your help and patience.
Klaus