[jboss-user] [JBoss Seam] - Re: Question on Stateless Session Bean

quilleashm do-not-reply at jboss.com
Tue Mar 27 11:26:59 EDT 2007


Application scope should be fine for the above examples if you do the initial work in @Create and then just access it.  Of course provided the data is the same for all users.

Be aware of threading issues in application scope tho as multiple threads may access it at the same time.  If you do all your loading in @Create it should be fine.


  | @Name( "cache" )
  | @Scope( ScopeType.APPLICATION )
  | @Intercept( InterceptionType.NEVER )
  | public class Cache
  | {
  |   private Map cache;
  | 
  |   @Create
  |   public void create()
  |   {
  |     // build cache here...
  |   }
  | 
  |   public Map getCache()
  |   {
  |     return cache;
  |   }
  | }
  | 

HTH.

Mike.

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

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



More information about the jboss-user mailing list