Can you explain the term concurrency?
Concurrency issues happen in multiuser environment when multiple people update the same data at the same time.
Below is the sequence of events how concurrency issues can happen:-
- User A fetches data with value “X” and starts changing this value to “Y”.
- User B also fetches the same “X” data and starts changing this value to “Z”.
- Now User B first updates the data to database. In other words he changes the data to “Z”.
- Now User A also sends the update to database. In other words he changes the data to “Y”.
Now User A thinks he has changed “X” to “Y” and User B thinks the current data is “Z”. Both of them are wrong and this leads to confusion termed as “Concurrency” problem.
How can we resolve concurrency issue?
Concurrency issue can be resolved by using optimistic or pessimistic locking.
What are the major differences between classic ADO and ADO.NET?
Following are some major differences between both:-
- In ADO we have recordset and in ADO.NET we have dataset.
- In recordset we can only have one table. If we want to accommodate more than one tables we need to do inner join and fill the recordset. Dataset can have multiple tables.
- All data persist in XML as compared to classic ADO where data persisted in Binary format also.
See following video on Dataset is a disconnect while datareader is connected: -
Click and see here for more training on ADO.NET