• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Synchronization

 
John Landon
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I have a database table, web service, and multiple web clients.
My web service can have multiple unrelated instances (running on separate jvms).
The web clients might hit the services and ask for records from the table. What I want to avoid is that 2 clients will get the same row of the table simultaneously (or while other service is processing it) from the same instance of the service or multiple instances.
If I synchronize the piece of code that accesses the DB on the service side it won�t help me because other service from other jvm might still give this row to other client.
How do I solve this?

Thanks,
John
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some databases have row-level locking; would that help?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What I want to avoid is that 2 clients will get the same row of the table simultaneously (or while other service is processing it) from the same instance of the service or multiple instances.

If you are running with a high enough transaction isolation level, why does this matter?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic