Hi Denis, store a handle. It is guaranteed to be serializable if your servlet engine decides to swap out the HTTP session state.
Cheers... Matthias --- Matthias Bohlen "Consulting that helps project teams to succeed..." http://www.mbohlen.de/ -----Original Message----- From: A mailing list for Enterprise JavaBeans development [mailto:[EMAIL PROTECTED]] On Behalf Of Denis Kranjcec Sent: Tuesday, August 27, 2002 1:58 PM To: [EMAIL PROTECTED] Subject: how to store references to EJBs in client session Hello everyone I'm developing standard web application with servlets/JSP and EJBs (stateless and stateful). I have utility class that creates EJB and store remote interface to client session (HttpSession). This is sample code: Object objref = initialContext.lookup(JNDINames.LOGIN_EJBHOME); LoginHome loginHome = (LoginHome) PortableRemoteObject.narrow(objref,LoginHome.class); loginRemote = loginHome.create( (String) session.getAttribute(Keys.jmbag) , (UserData) session.getAttribute(Keys.userData) ); session.setAttribute(Keys.LoginRemoteKey,loginRemote); I'm not sure if this is right way to store references to EJBs (maybe some pooling problems etc.?). Should I store handles or should I do something else? Any suggestions or links? Thanks in advance! Denis Kranjcec ======================================================================== === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". ==========================================================================To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
