Concurrent ASP.NET Session Best Practices

User A registers with the ticket management system to edit content on "SomePage.aspx"

User B registers after 30 seconds to edit the same ticket on "SomePage.aspx"

What are some of the best-known practices (in a three-tier architecture) for notifying each user that someone else is modifying the same content?

+3
source share
5 answers

Roundup uses (for example) an optimistic concurrency approach: when sending changes, you can see a warning that someone made the changes before you, with a link to a page indicating their changes. You can click Submit to simply continue making changes or change the values ​​on the form and then submit.

This works fine for the ticketing system because there is a bit of general condition in the ticket - basically you add to the message log (or equivalent), so 2 messages are added one after another.

+2
source

/, HTTP, , . , - " " ( ), A - . , , , A "" , - .

, ( / , ) . :

  • ( , )
  • ( - , )
  • ( / , ). ( ).
  • , , ( - - , ).
+7

, - , EditingBy ' 0'.

TicketID = 897, :

SELECT * FROM Tickets WHERE TicketID = 897; 
UPDATE Tickets SET EditingBy = @UserID WHERE TicketID = 897;

, EditingBy 0, UserB, UserA ( , UserID) , SO, - , , , .

0.

, SomePage.aspx , , javascript onUnload body, , EditingBy 0 .

hop, .

: EditingBy XML , , TicketID UserID, , , 0, , TicketID XML.

+1

concurrency - , timestamp : SQLTimeStamp. . A , sqltimestamp . B A, sql . A , , , , , , - .

, -.

+1

I assume that you are talking about a reference ticket or something similar, where only one user should work on it at a time. In this case, the ticket status should change when the first user checks it.

0
source

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


All Articles