我应该进行并发处理吗? [英] Should I go for concurrency handling?

查看:82
本文介绍了我应该进行并发处理吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在从事与保险和金融领域相关的项目。它是基于EDMX的基于Web的应用程序。我们使用ASP.NET 4.5和Sql Server 2008的平台。我们有很多屏幕,并且有很多地方可以保存重复记录。我们在数据库表中放置了唯一的非集群索引,但没有明确地进行任何并发处理。



我不确定为什么我们的技术总监没有实现并发处理,但我想可能是因为性能问题。我们有很多表,并且有很多用于触发的插入,更新和删除。



因此,如果我们明确地进行并发处理,那么我们可能面临严重的性能问题?





谢谢。



问候,

Nivedita

解决方案

如果正确处理并发处理,我相信你不会遇到任何性能问题。



在我看来,关键是使用乐观并发处理而不是锁定更长的时间。对此的技巧是使用rowwversions。



对于初学者,请查看例如使用行版本在SQL Server中进行数据版本控制 [ ^ ]。



在更新DML语句中还引入类似RVV的标识符,您可以轻松发现潜在的丢失更新。当更新是连续的时,这是唯一的约束和锁定不会处理的事情:)


感谢Mika的响应......我肯定会更多地了解你的建议!!

Hi,

I am working in a project related to Insurance and Finance domain. It is a web based application based on EDMX. The platforms which we are using ASP.NET 4.5 and Sql Server 2008. We have many screens and there are lots of places from where duplicate records can get saved. We have put unique non-cluster indexes in database tables but not doing any concurrency handling explicitly.

I am not sure about the reason that why our technical directors has not implemented concurrency handling but I guess might be because of performance issues. We have lots of tables and there are lots of inserts, updates, deletes used to fire.

So is it like if we are doing concurrency handling explicitly, then we may face serious performance issues?


Thank you.

Regards,
Nivedita

解决方案

If concurrency handling is done properly, I believe you won't be facing any performance problems.

The key thing in my opinion is to use optimistic concurrency handling instead of locking for longer periods of time. The technique for this is to use rowwversions.

For starters, have a look at for example Data versioning in SQL Server using row versions[^].

Also introducing RVV like identifier in the updating DML statements you can easily spot potential lost updates. This is something that won't be handled by unique constraints and locks when updates are sequential :)


Thanks for the response Mika... I would definitely dig more into your suggestion !!


这篇关于我应该进行并发处理吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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