Storing write tokens in ASP.NET

In the application I'm working on now, several users can edit something at the same time, which means that we need to implement optimistic locking. However, for this application, the editable element is a scientific protocol that contains records from several different tables in the database.

Thus, we want to be able to indicate that the entire protocol was blocked for editing by one user, which leads to my question: would there be a preferred way to do this for making changes at the database level (for example, a table with a unique protocol identifier and check if whether it is blocked) or would it be customary to monitor blocked protocols on the web server itself in memory?

Currently, we expect about 100 users (about 20 at a time) for the application, but this number may increase in the future, so we strive to use the most scalable option.

+3
source share
3 answers

This question also really depends on how well designed your code base is.

If all the calls to change these entries go through a single entry point, then yes, I recommend that you keep the lock code in your application completely so that you can store your database as a silent data store.

If you have multiple entry points that can modify your tables, you will need to implement database-level locking.

+5

, . :

: ProtocolID, EditingBeginDate, EditingEndDate

, , , , . , , . : -D

+3

, , .

, ( ). - , . - , .

+2
source

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


All Articles