[英]Handling concurrency issues for asp.net C# / SQL Server application
How can I handle concurrency issues for an asp.net 4.5 web application (VS2012 and C#, SQL Server) 如何处理asp.net 4.5 Web应用程序(VS2012和C#,SQL Server)的并发问题
For example: 例如:
My scenario is a user might have a chance that is never able to process a queue item. 我的情况是用户可能永远无法处理队列项目。 See the following:
请参阅以下内容:
That will not be ideal for the user A, even though the percentage of this possibility could be really small 即使这种可能性的百分比可能很小,这对于用户A也不是理想的
I am using transactions at the C# code level as well as at the SQL Server stored procedure level. 我正在C#代码级别以及SQL Server存储过程级别使用事务。 Also I make use of ADO.net to communicate with database
我也利用ADO.net与数据库进行通信
My questions are: 我的问题是:
In short: You may resolve concurrency issues by using traditional method called timestamp column. 简而言之:您可以使用称为timestamp列的传统方法解决并发问题。
The timestamp column of a table can be used to determine whether any value in the table row has changed since the last time the table was read.
表的时间戳列可用于确定自上次读取表以来,表行中的任何值是否已更改。 This article describes a way to use the timestamp column of a table for optimistic concurrency control in Microsoft SQL Server 2005.
本文介绍了一种使用表的时间戳列进行Microsoft SQL Server 2005中的乐观并发控制的方法。
To get more detailed explanation of this approach, follow this article 要获得有关此方法的更多详细说明,请关注本文。
In addition , you may also look at step-by-step implementation guidelines of Implementing Optimistic Concurrency with SQL Timestamps . 此外 ,您还可以查看使用SQL时间戳实现乐观并发的分步实施指南。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.