Concurrency

  • Thread starter Thread starter Usarian Skiff
  • Start date Start date
U

Usarian Skiff

I want to be able to check back to the database for potential concurrency
issues using a timer. I do not want to copy my application dataset over to
a temp dataset and refill from the adapter to do it. Is there a property I
can read anywhere, or maybe an event that gets fired when the database is
updated by another user?

Thanks
 
Hi Usarian,

No. The only thing that comes to my mind are Sql Server notification
services (if you are using sql server of course).
Other than that - you could manually compare concurrency field (a timestamp
for example) of each loaded row against database row.
 
Usarian,

Even though you could do something like this using SqlNotification or
various dependency objects, this is not the approach I would recommend, as
it results in a lesser scalable architecture. You should instead use a
combination of pessimistic and optimistic concurrency.

In other words, where the user doesn't have 10 minutes of work that may be
lost, you can simply use regular optimistic concurrency, but where there is
a danger of user frustration (due to 10 minutes of work being lost), you
could instead build a check-in/check-out mechanism instead. And specifically
to execute the check-in / check-out process in your business logic you could
at that point use pessmistic concurrency or implicit locks with transactions
to ensure data sanctity.

Look at it this way, even if you did get the notification working, it still
isn't much use. Because if I get the notification in the 7th minute of my
editing informing me that "Whatever I am doing cannot be saved because user
2 saved before I did" - that is .. well frustrating. :-)

HTH :-)
 
Back
Top