Getting EJB Objects from Handles.....


EJB programming & troubleshooting: Getting EJB Objects from Handles.....

  1. Getting EJB Objects from Handles..... (1 messages)

    Hi all!

    I drove into a wall with this one:

    I have a Stateful Session Bean that is to work as a Session Manager for a product in WebLogic. The product can have multiple JVMs running other Java Programs outside of the WebLogic environment.

    Every user has a unique session id, and I would like to use this id to reference the bean object. I have stored the EJB Handles in a HasMap, using the session-id as a reference, but this does not work when the client uses a different JVM, of course.

    Is there another way to access a Bean using a Handle, and also possible through multiple JVM's?


  2. Getting EJB Objects from Handles.....[ Go to top ]


      Since a bean instance created in an ejb container has a unique session id the jvm where it is created, it isn't possible to access a bean in another jvm with the session id of another jvm. in order to do that, you need to create an instance of bean in another jvm and use the
    EJBObject.getHandle() to obtain the handle to the bean. Now the beans instance can be accessed using the session id for the second jvm.