aspose file tools*
The moose likes JDBC and the fly likes Synchronization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Synchronization" Watch "Synchronization" New topic
Author

Synchronization

John Landon
Ranch Hand

Joined: Sep 25, 2008
Posts: 227
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

Joined: Jul 08, 2003
Posts: 24183
    
  34

Some databases have row-level locking; would that help?


[Jess in Action][AskingGoodQuestions]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


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?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Synchronization