How to handle concurrency control in ASP.NET dynamic data?

I was impressed by the dynamic data, and how easy and quick to get a simple site and run it. I plan to use it for a simple internal HR administration site for registering people's skills / degrees / etc.

I watched intro videos at www.asp.net/dynamicdata, and one thing they never mention is a way to control concurrency.

It seems that DD cannot do this right out of the box (unless there is some setting that I have not seen), because I manually created an exception to the change conflict and the application failed without a user-friendly message.

Does anyone know if DD supports it out of the box? Or do you need to somehow create it on the site?

+3
source share
6 answers

Concurrency is not processed in the DD field.

0
source

One approach is to implement this on the database side by adding a “last updated” time column (or other unique mark, such as a GUID) to each table.

Then an update trigger is created for each table. For each updated row, is the “last updated” mark passed on the same row as the row in the database? If so, update the line, but give it a new “last updated” print. If not, raise the specific "Data is out of date" exception.

" ".

" " , .

, .

0

, " ". - concurrency, .

" concurrency" rowversion SQL Server. " " , . "timestamp" SQL . Concurrency Sql. , .

0

, . , concurrency (/) , App_Init. , , , , ....

0

. DD , . , .Net 4.0. DD .Net 4.0.

DD Linq sql. .

linq to SQl, , , wheater, . true, , .

.

.

0

, Binary Worrier, , (, , wiki ..). , . , DLL.

If this does not suit you, the other approach is only to block the record being edited. No one will be able to edit this entry until the user makes a change or ends his session. This has pros and cons, but it requires a little code compared to the first option.

0
source

Source: https://habr.com/ru/post/1748066/


All Articles