Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

are Home object and EJB object multi-thread?

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
are Home object and EJB object multi-thread?
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks, but ejb bean instance is always single-thread. am I correct?
 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic