This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

EJB calling syncronized method

Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Does anybody knows is it allowed to call syncronized method from EjbBean(sync method in other object, not in ejb)?

My problem is the following: the database table has rows.
An operator uses GUI to get rows from db to browse, then can modify any single row(also do some other things).

Many operators are working with GUI, so 2 operators can browse the same rows, but one row can be modified by one operator only.
I use EJB to get & modify rows. My web module calls EJB to perform fetching and modification.

The problem is when EJB instance(operator1) is modifing some DB record, the other EJB instance(operator2) overwrite the changes.

The solution can be to place modification logic to syncronized method, so this method will be called from multiple EJB instances.
Is it allowed?
Any other ideas?

I use EJB 2.1.

Ranch Hand
Posts: 66
VI Editor Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator - does this answer your question?
If somebody says you look familiar, tell them you are in porn. Or in these tiny ads:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!