Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Concurrency Issue

 
Vaibhav G Garg
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 3751
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The scenario you've described is usually called "lost update". Optimistic locking can often be used to avoid it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic