|
From: Sacha L. <Sac...@co...> - 2001-12-28 09:35:50
|
Hello Bill,
I think that the goal was more to have something like this:
HttpSession session = home.findByPrimaryKey(sessionId);
byte[] state = session.getState ();
// here Julian do whatever he wants with its state...
// if he wants, he could convert its state in an Hashtable
...
// and later
session.setState (state);
Cheers,
Sacha
> -----Message d'origine-----
> De : jbo...@li...
> [mailto:jbo...@li...]De la part de Bill
> Burke
> Envoyé : vendredi, 28 décembre 2001 06:38
> À : jbo...@li...
> Objet : [JBoss-dev] can't use EJBs for HttpSessions.
>
>
> I'm not sure you can use an EntityBean or any type of EJB for
> that matter to
> implement HttpSessions. Maybe I'm getting too religious here (meaning too
> EJB spec oriented), but EJB semantics require that input parameters and
> return parameters be serialized(copied). Sure, JBoss doesn't do this by
> default, but maybe some users turn off this optimization to be EJB Spec
> compliant. Why is this a problem? Consider that HttpSession is
> implemented
> as an EntityBean.
>
> You do:
>
> HttpSession session = home.findByPrimaryKey(sessionId);
> ...
>
> Then in user code:
>
> Object attr = session.getAttribute("some attribute");
>
> attr.setSomeValue("foobar");
>
>
> Now, if HttpSession is implemented as an EntityBean, or SFSB, and
> optimization was turned off, the attribute would not be changed within the
> HttpSession.
|