> -----Ursprüngliche Nachricht-----
> Von: Dain Sundstrom [mailto:[EMAIL PROTECTED] 
> Gesendet: Dienstag, 17. Juni 2008 20:39
> An: [email protected]
> Betreff: Re: AW: Store data in SessionContext
> 
> On Jun 17, 2008, at 6:15 AM, <[EMAIL PROTECTED]> 
> <[EMAIL PROTECTED]  > 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
> 

Reply via email to