并发概述(LINQ to SQL)

并发(Concurrency)分为开放式并发(Optimistic Concurrency)保守式并发(Pessimistic Concurrency). LINQ to SQL 支持开放式并发控制。下表介绍涉及开放式并发的术语: 

术语

说明

并发

Concurrency

两个或更多用户同时尝试更新同一数据库行的情形。

The situation in which two or more users at the same time try to update the same database row.

并发冲突

Concurrency Conflict

两个或更多用户同时尝试向一行的一列或多列提交冲突值的情形。

The situation in which two or more users at the same time try to submit conflicting values to one or more columns of a row.

并发控制

Concurrency Control

用于解决并发冲突的技术。

The technique used to resolve concurrency conflicts.

开放式并发控制

Optimistic Concurrency Control

先调查其他事务是否已更改了行中的值,再允许提交更改的技术。

相比之下,保守式并发控制则是通过锁定记录来避免发生并发冲突。

之所以称作开放式控制,是因为它将一个事务干扰另一事务视为不太可能发生。

The technique that first investigates whether other transactions have changed values in a row before permitting changes to be submitted.

Contrast with pessimistic concurrency control, which locks the record to avoid concurrency conflicts.

Optimistic control is so termed because it considers the chances of one transaction interfering with another to be unlikely.

冲突解决

Conflict Resolution

通过重新查询数据库刷新出现冲突的项,然后协调差异的过程。

刷新对象时,LINQ to SQL 更改跟踪器会保留以下数据:

l         最初从数据库获取并用于更新检查的值。

l         通过后续查询获得的新数据库值。

LINQ to SQL 随后会确定相应对象是否发生冲突(即它的一个或多个成员值是否已发生更改)。 如果此对象发生冲突,LINQ to SQL 下一步会确定它的哪些成员发生冲突。

LINQ to SQL 发现的任何成员冲突都会添加到冲突列表中。

The process of refreshing a conflicting item by querying the database again and then reconciling differences.

When an object is refreshed, the LINQ to SQL change tracker holds the following data:

l         The values originally taken from the database and used for the update check.

l         The new database values from the subsequent query.

LINQ to SQL then determines whether the object is in conflict (that is, whether one or more of its member values has changed). If the object is in conflict, LINQ to SQL next determines which of its members are in conflict.

Any member conflict that LINQ to SQL discovers is added to a conflict list.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值