[jboss-user] [EJB 3.0] - Re: EJB3 business delegates?

ALRubinger do-not-reply at jboss.com
Thu May 14 13:28:59 EDT 2009


You should absolutely cache SLSB proxies.  Do the lookup once, then you may pass around and share this instance.

This is because the proxy you lookup may target *any* of the underlying bean instances in the pool.  Assuming you've done a good job to ensure your SLSB has no *conversational state*, all SLSB proxies are identical from the perspective of the caller/client.  This means that if your SLSB has internal instance variables, they must *not* be exposed out.

ie. Instance variables initializing some internal state for your SLSB == OK.  Caching user authorization tying some bean instance to a particular request or caller == Bad.

For conversational state, use SFSB.  These may not be cached in the same fashion, in that each "conversation" should reference the same SFSB instance and no others.

S,
ALR

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4231140#4231140

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4231140



More information about the jboss-user mailing list