如果快照事务隔离避免在客户端ADO.NET应用程序?那么,什么是它的主要目的是什么? [英] Should snapshot transaction isolation be avoided in client ADO.NET applications? then, what was its main purpose?

查看:121
本文介绍了如果快照事务隔离避免在客户端ADO.NET应用程序?那么,什么是它的主要目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在读[1]:

  • 在持久数据库连接的要求限制快照隔离的可扩展性,因此不应该被用作实现乐观并发的通用方法

我想明白了:
什么是ADO.NET持续连接?
我根本不记得,在编程.NET应用程序,我配置SQL Server连接的任何持久性。
在哪里?

I'd like to understand:
What is persistent connection in ADO.NET?
I simply do not remember that, while programming .NET apps, I configured any persistence of SQL Server connections.
Where was it?

时的连接模式持续连接的反义词?

Is "persistent connection" antonym of disconnected mode?

什么是需要影响到在编码ADO.NET客户端的应用程序永久连接(在,恩,C#)?
如何快照事务隔离在ADO.NET客户端应用程序中使用?
什么是参与的(快照事务隔离级别)的主要目标区域?

What are implications of the need to have persistent connection in coding ADO.NET client apps (in, for ex., C#)?
How snapshot transaction isolation is to be used in ADO.NET client apps?
What is its (snapshot transaction isolation levels) main target area of engagement?

另外,我有些糊涂,看了大多数.NET框架和功能,如,为前,LINQ2SQL,不支持保守式锁定(当然,提示)......但分布式事务不支持快照隔离[ 2]

Also, I am somewhat confused, having read that most .NET frameworks and features, like, for ex., Linq2SQL, do not support pessimistic locking (well, hints)... but distributed transactions do not support snapshot isolation [2]

如果SQL Server内置的乐观并发功能来避免和定制乐观(版本)事务支持取代?
再次,什么是对和他们为什么在这样的介绍(很难理解对我来说)执行?

Should SQL Server built-in optimistic concurrency functionalities be avoided and substituted by custom optimistic (versioning) transaction support?
Again, what's for and why were they introduced in such (difficult to understand for me) implementation?

[1]丹·古斯曼的博客。
并发型号混乱II
http://weblogs.sqlteam.com/dang/archive/2008/06/07/Concurrency-Model-Confusion-II.aspx
[2]
为什么没有快照隔离在SQL Server的
分布式事务支持 <一href="http://stackoverflow.com/questions/1331734/why-isnt-snapshot-isolation-supported-with-distributed-transactions-in-sql-serve">Why是不是快照隔离在SQL Server的
分布式事务支持 [3]
当美元的事务隔离p $ PFER悲观模型过于乐观呢?
<一href="http://stackoverflow.com/questions/4088430/when-to-$p$pfer-pessimistic-model-of-transaction-isolation-over-optimistic-one">when以事务隔离了乐观的preFER悲观模式呢?

[1] Dan Guzman's Blog.
Concurrency Model Confusion II
http://weblogs.sqlteam.com/dang/archive/2008/06/07/Concurrency-Model-Confusion-II.aspx
[2]
Why isn't Snapshot isolation supported with Distributed Transactions in SQL Server
Why isn't Snapshot isolation supported with Distributed Transactions in SQL Server
[3]
when to prefer pessimistic model of transaction isolation over optimistic one?
when to prefer pessimistic model of transaction isolation over optimistic one?

推荐答案

虽然文档不是很清楚,我,这里是我如何跨preT它。如果我在我专用的连接,我可以使用快照隔离来实现乐观并发,因为我在这篇文章中描述:<一href="http://www.simple-talk.com/sql/t-sql-programming/developing-modifications-that-survive-concurrency/"相对=nofollow的生存并发>开发修改。如果有冲突,你会得到一个错误信息:快照隔离事务中止由于更新冲突

Although the documentation is not quite clear to me, here is how I interpret it. If I have a connection in my exclusive use, I can use snapshot isolation to implement optimistic concurrency, as I described in this article: Developing Modifications that Survive Concurrency. If there is a conflict, you will get an error message: "Snapshot isolation transaction aborted due to update conflict."

然而,利用这种方法,我们必须保持连接打开,我们不能使用连接池。请注意,在某些环境中空闲连接部分闲置一段时间后自动死亡。

However, to utilize this approach, we must keep the connection open, and we cannot use connection pooling. Note that in some environments idle connections are automatically killed after some idle period.

这篇关于如果快照事务隔离避免在客户端ADO.NET应用程序?那么,什么是它的主要目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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