• Post Reply Bookmark Topic Watch Topic
  • New Topic

Home objects thread safe?

 
Rick DeBay
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are home objects thread safe? I'd like to look them up only once and then cache them. Obviously this won't work if multiple threads can't use them at the same time.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, EJBHome objects are threadsafe and it is very common to cache them for client side access. There is actually a Pattern devoted to this in Floyd Marinescu's EJB Design Patterns: Advanced Patterns, Processes, and Idioms book called EJBHomeFactory.
 
Rick DeBay
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. I wrote such a cache when I started working with EJBs a few months ago, but I just assumed they were thread safe.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!