954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Concurrent User issue.

Hi, I am using asp.net with SQL2008 facing a concurrent user issue, if 2 users launches the application and clicks save then it is allowing to save the record twice. I need to avoid saving duplicate record. How can i acheive this?
1 thing i thought of taking Modifiedat value at the time of launching and comparing this value with database record if it differs then i will display message to 2nd user. Now the problem is we have migrated records which has same data of modifiedat.

Can any one let us know the best way to handle concurrency issue.
Your help is much appreciated.
-Mani

lbmanikandan
Newbie Poster
2 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
 
__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

Thanks for your reply, Nice option but i have a query where both Users launches application @SAMETIME and clicks SAVE @SAMETIME, In this case 2 records will be persisted in database though this is rare scenario but still we need to address this as a matter of maintaining correct data. Not sure how this can be addressed.
Awaiting a response.

lbmanikandan
Newbie Poster
2 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
 

@lbmanikandan

You can use Optimistic concurrency with ADO.NET Dataset and have a look at thread here at Daniweb.

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: