Friday, March 13, 2009

I have created a remote reference to an EJB in FirstServlet. Can I put the

Question :I have created a remote reference to an EJB in FirstServlet. Can I put the
reference in a servlet session and use that in SecondServlet? (EJB)

Answer :Yes. The EJB client (in this case your servlet) acquires a remote reference
to an EJB from the Home Interface; that reference is serializable and can
be passed from servlet to servlet. If it is a session bean, then the EJB
server will consider your web client's servlet session to correspond to a
single EJB session, which is usually (but not always) what you want.

No comments: