AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 11.08.2012, 01:27   #1  
Blog bot is offline
Blog bot
Участник
 
25,488 / 846 (79) +++++++
Регистрация: 28.10.2006
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, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Danny Varghese: CRM 2011 External Connector Blog bot Dynamics CRM: Blogs 0 21.06.2011 05:21
Danny Varghese: CRM 2011 VM Released Blog bot Dynamics CRM: Blogs 0 07.06.2011 12:11
Danny Varghese: Dynamics CRM 2011 Licensing Blog bot Dynamics CRM: Blogs 0 18.05.2011 03:15
Danny Varghese: Latest Changes Made To SQL Database Blog bot Dynamics CRM: Blogs 0 17.05.2011 21:11
kamalblogs: Adjusting the No.of decimal property for Quantity field in Dynamics Ax Blog bot DAX Blogs 0 25.02.2011 10:11

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 13:22.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.