11.08.2012, 01:27 | #1 |
Участник
|
Danny Varghese: Query Expression No Lock Property
Источник: http://varghesedanny.com/2012/08/10/...lock-property/
============== There’s a new property called “NoLock” added to the QueryExpression class for Microsoft Dynamics CRM 2011. I found this researching a locking issue on the database we were having for a client. According to the Microsoft CRM 2011 SDK: “The benefit of setting NoLock to true is that it allows you to keep the system from issuing locks against the entities in your queries; this increases concurrency and performance because the database engine does not have to maintain the shared locks involved. The downside is that, because no locks are issued against the records being read, some “dirty” or uncommitted data could potentially be read. A “dirty” read is one in which the data being read is involved in a transaction from another connection. If that transaction rolls back its work, the data read from the query using NoLock will have read uncommitted data. This type of read makes processing inconsistent and can lead to problems. “ The risk of having “dirty” data is something to consider, especially in high database transaction environments. An example of a query expression using this property is below: QueryExpression query = new QueryExpression { NoLock = true, EntityName = “account”, ColumnSet = new ColumnSet(“name”), Criteria = new FilterExpression { Conditions = { new ConditionExpression { AttributeName = “statecode”, Operator = ConditionOperator.Equal, Values = {0} }, new ConditionExpression { AttributeName = “accountid”, Operator = ConditionOperator.Equal, Values = {accountid} } } } }; Источник: http://varghesedanny.com/2012/08/10/...lock-property/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|