This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JDBC and the fly likes Concurrency Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Concurrency Issue" Watch "Concurrency Issue" New topic
Author

Concurrency Issue

Vaibhav G Garg
Ranch Hand

Joined: Sep 23, 2011
Posts: 140
I have to work upon the scenario. Suppose there are 2 users. 1st user opens up a page and updates some data. The 2nd user also opens up the same page and updates the same data. The first user submits the data first and then the 2nd user submits the data. So, it corrupts the data in the database. So, how to handle such scenarios.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

The scenario you've described is usually called "lost update". Optimistic locking can often be used to avoid it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Concurrency Issue