users@glassfish.java.net

Where & How to store some data which to be common for the whole session

From: Miroslav Nachev <miro_at_space-comm.com>
Date: Sun, 18 May 2008 21:46:42 +0300

Hi,

I would like to store some data which to be common for the whole
session. When some Stateless or Stateful EJB access that data, this to
be the same data. My first idea was to use SessionContext because this
is unique for the whole session but I can not find where I can put some
user data there.

Then I try to use Stateful EJB but it seams that each instance is not
the same:
    @Stateful
    public class StatefulBean
    { ... }

    @Stateless
    public class StatelessBean
    {
        @EJB
        private StatefulLocal stateful;
    }


Is there something like:
    Session.put(key, value)
    Session.get(key)


Regards,
Miro.