Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

are Home object and EJB object multi-thread?

 
Win Yu
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are Home object and EJB object multi-thread?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are Home object and EJB object multi-thread?

Well that depends. It really is up to the Application Server. You don't need to synchronize anything, because the App server ahndles it for you here. And the EJB Object depeneds on Pooling. Either the App Server has a pool of EJB Objects, or a single instance, it is still thread-safe, because the App Server handles that.
Mark
 
Win Yu
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, but ejb bean instance is always single-thread. am I correct?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"but ejb bean instance is always single-thread"
Are you talking about Entity Beans? I think one bean is shared for each "Record" in the persistence layer.
Mark
 
Win Yu
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mark Spritzler:
"but ejb bean instance is always single-thread"
Are you talking about Entity Beans? I think one bean is shared for each "Record" in the persistence layer.
Mark

Yes, they maybe shared. But all bean instances are single-threaded as page 115 of Master EJB.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic