• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Concurrency in entity bean

Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have just started with EJB, I have doubt regarding how a container implements concurrency when it comes to Entity bean.
Book(EJB by Richard) says that in entity bean instance can't be accessed concurrently though the EJBObject is shared by more than one client.My doubt is
If there is pool of instance (of beans) and two EJBObject associated with two different clients, both access the EJBObject at the same. Then instance associated with two EJBObject will be different ones.But the data in database represented by the EJBObject(or bean instance) will be same.When one Client changes the data and the other overrides the change, there is a chance at some point the data represented by the instances may be different.
Can some one please explain to me how a container takes care of this concurrency problem.

Thank you
Posts: 3892
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Database level locking solves the problem. All the container does is use the appropriate database commands (like SELECT..FOR UPDATE) to lock the rows appropriately.
Every container is different. For an explanation of how WebSphere solves this problem, take a look at this article..
The knights of nee want a shrubbery. And a tiny ad:
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic