users@glassfish.java.net

Re: Stateful EJB3 and InitialContext query

From: <glassfish_at_javadesktop.org>
Date: Fri, 06 Jun 2008 07:45:13 PDT

> So a stateful EJB is only stateful within a single
> servlet?

There's no special association to a servlet. Each Stateful Session bean reference represents a
unique piece of state. It's up to the creator of that reference to decide where to store it. If you
need access to that same state across multiple web invocations, the best place to store it is in an
HttpSession. You could also store it more globally in a per-web application data structure such as
a ServletContext attribute.
[Message sent by forum member 'ksak' (ksak)]

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