Nagu
Nagu

Reputation: 5114

DB Operations in asp.net with c#

I have a question from an interviewer:

If two users open the same page, one person adding 105 record and another person deleting the same record, what happens in this scenario?

How do I answer this?

Upvotes: 1

Views: 118

Answers (2)

RickNZ
RickNZ

Reputation: 18652

Potential conflicts are resolved in two places. First, on the web tier, using locking to make sure that each request is looking at consistent data.

Second, at the database tier, using transactions.

Upvotes: 0

Kyle Rosendo
Kyle Rosendo

Reputation: 25287

That's a bit odd, as the records would not be there yet to delete if this was simultaneous access. Anywho, I am sure they are looking at Concurrency, and probably Optimistic Concurrency.

Have a look at this page, showing how to implement Optimistic Concurrency with ASP.NET.

Upvotes: 2

Related Questions