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

The Syncronized block in EJBs

 
sandeep vaid
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • 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
 
Jeff Walker
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic