users@glassfish.java.net

Register stateful session bean EJB in JNDI during runtime

From: <glassfish_at_javadesktop.org>
Date: Mon, 25 Jun 2007 00:47:06 PDT

Hi

Is it possible to register a stateful session bean in JNDI during runtime? The purpose would be to access the state of the stateful beans from other beans (MDBs or other session beans).

Everything I have read says something close to: "A session bean is not shared; it can only have one client...". My boss however insists that you can get around this by registering the stateful bean in JNDI with a name specific to a specific instance of a stateful bean. This instance would then live until it is removed from JNDI. Is that true? How would it be done?

To me it seems that this goes against what a session bean ejb is supposed to do and that any information of state that is to be shared between different components (ejbs) will have to be stored in an entity bean. Am I right?
[Message sent by forum member 'krippa' (krippa)]

http://forums.java.net/jive/thread.jspa?messageID=223741