[EMAIL PROTECTED] wrote:

> I have a question for the group and would greatly appreciate your
> responses.
>
> I am making a connection to a stateful session bean from a servlet. The
> connection to the session bean is made in the doGet method of the
> servlet. I make multiple connections to the servlet from the browser. My
> intention is to access the same stateful session bean for this multiple
> invocations of the servlet. Instead I am getting a new copy of the
> session bean for each individual invocation of the servlet. Is there a
> way to access the session bean across this multiple invocations of the
> servlet other than putting the session bean in the init method of the
> servlet. Do stateful session beans have a concept of a unique key by
> which they can be identified and retrieved? I am using Weblogic 4.5 EJB
> server.

Session beans are specific to the client who created them, in this case the
browser session.  Put the reference to the bean into the HttpSession and then
retrieve it on subsequent calls.  In other words, in doGet, try to retrieve the
session bean reference from the HttpSession.  If it is there, use it.  If it is
not there, create one, put it in the HttpSession, then use it.  It will be
there for subsequent calls from the same browser.
begin:vcard
n:Wilson;Chip
tel;work:214-642-4559
x-mozilla-html:TRUE
org:Axys Solutions
adr:;;14001 North Dallas Pkwy;Dallas;TX;75240;
version:2.1
email;internet:[EMAIL PROTECTED]
title:Director, Enterprise Java Practice
fn:Chip Wilson
end:vcard

Reply via email to