Win a copy of Microservices Testing (Live Project) this week in the Spring 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:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

The Syncronized block in EJBs

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Ejb Specs says that we can not have the sycronized code inside the ejb so how come we are able to call the vector/Hashtable's functions inside the EJB's They contains all syncronized code inside them. How is possible if it is against the spacifications of EJB.


Thanks!!
Sandeep Vaid
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sandeep vaid:
As Ejb Specs says that we can not have the sycronized code inside the ejb so how come we are able to call the vector/Hashtable's functions inside the EJB's They contains all syncronized code inside them. How is possible if it is against the spacifications of EJB.



I'm guessing that each EJB runs in its own thread and that the code (in the Container) that calls the ejbXXX() methods on the bean is itself running in a synchonized block of some sort.
-jeff
 
sandeep vaid
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think there will be no use having hashtable/Vector in EJB.
As each client have different instance of bean object. (i.e it is not multithreaded) so using hashtable/Vector will be overhead only, nothing will be gained out of it.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic