What will happen at the same time if two fields modified?

Posted by Satyadnet under ASP.NET on 4/17/2009 | Views : 1983 | Status : [Member] | Replies : 1
Hi everybody,

Suppose one table name as emp has eid,ename,esal as fields.
There are two applications(same application) in two systems which are fetched the data place it in dataset in each application.
Now one application has modified ename and another application has modified esal.
Now if both applications update(or save) the data at same in database. what will happen?
Please tell me. Advance thanks.


Posted by: Vuyiswamb on: 4/22/2009 [Member] [MVP] [Administrator] NotApplicable

Good Morning Satyadnet

That is Called Concurency. Let me explain, Concurency happens when two or more users retrieve Data and one of them Modify the data, when the second one try to mody the data, it will be stale data because the data has changed from its original state. There are Different ways to overcome concurency, i remember working for a Government Department in South Africa, I have 840 people working on my Application, now the good thing about this , was that every one has access to view certain Data, e.g user 1 cannot View the Data from City 1 but can only view the Data from City 2, So i did not put more constraints on the users choice to see the Data, what i did i locked a Record when it was retrieved, i did my locking manualy from the SQl and Application side, when i mean manually i mena i had to have an sp that will lock the Record if the user Retrieved it, and if the record has been locked by another user, the second user will have read only access on the record until the locking user has finished working on the Record. This is not always an option to other areas of our Career, Mybe your users will like to update the Record both of them.

Look at the Following Articles , they might help








Thank you For Posting at Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda

Satyadnet, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response