如何处理这个问题 [英] How toHandle this Issue

查看:88
本文介绍了如何处理这个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在页面加载时有一个函数,如果计数增加,函数会计算表的数量

到100它删除表的前40个记录但问题是当千或万时

用户同时出现了显示值= 800的计数器,在几分钟后直接显示600的值,根据输出不正确显示什么是最佳解决方案

使用Locking,TransactionScope,这是最好的解决方案

I have one function at page load that function counts the count of the table if the count increase
to 100 it delete TOP 40 records of the table but the problem is that when thousand or ten thousand
user came at same time the counter that is showing the value = 800 that directly display after some minutes display the value of 600 which is not proper according to the output what is the best solution
to use Locking , TransactionScope, which is the best solution

推荐答案

我会在流程中更高的路线计数。也许在插件完成的位置并将事务隔离级别设置为read committed。
I would proforma your route count higher up the process. Perhaps where the inserts are being done and set transaction isolation level read committed.


这篇关于如何处理这个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆