tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Karsten.O...@t-systems.com>
Subject Re: AW: Store data in SessionContext
Date Wed, 18 Jun 2008 08:19:28 GMT
> -----Urspr√ľngliche Nachricht-----
> Von: Dain Sundstrom [mailto:dain@iq80.com] 
> Gesendet: Dienstag, 17. Juni 2008 20:39
> An: users@openejb.apache.org
> Betreff: Re: AW: Store data in SessionContext
> 
> On Jun 17, 2008, at 6:15 AM, <Karsten.Ohme@t-systems.com> 
> <Karsten.Ohme@t-systems.com  > wrote:
> 
> > Hi David, hi Dain,
> >
> > I have tried to use the
> > javax.interceptor.InvocationContext.getContextData() approach.  
> > Unfortunately it did not works, because The 
> InvocationContext differs 
> > for me. I have two Interceptor, one is picking up the 
> necessary return 
> > value for me the other should rollback it. The rollback interceptor 
> > intercepts different methods, so the invocation context is 
> different 
> > and the contained map also.
> >
> > Now my choosen approach is to use a static ThreadLocal in one 
> > interceptor.
> >
> > Question regarding this:
> >
> > Why are static fields allowed in stateless beans? In my EJB 
> 3.0 spec 
> > it is not allowed.
> >
> > Are static fields also allowed in interceptors like I want to do it?
> 
> According to the spec they are not allowed, but it is an 
> unenforceable and in my opinion a stupid restriction.  To my 
> knowledge no vendor actually stops you from using static 
> fields.  If you really really  
> want to be spec compliant, put the actual field in another class.   
> This is legal since EJBs are allowed to use other Java classes.

So it is always the case that during the execution of a bean chain each bean stays on the
same server instance? Or can it be imagined that some mechanism distributes beans to other
VMs where the static information is missing?

Regards,
Karsten
> 
> -dain
> 

Mime
View raw message