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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 25.06.2014, 12:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
mfp: X++ Debugging Tips and Tricks #4 - Reading uncommitted data
Источник: http://blogs.msdn.com/b/mfp/archive/...tted-data.aspx
==============


This next trick in the X++ Debugging Tip and Tricks seriesis invaluable when stuck deep in a debugging session, and want to verify that the SQL statements being executed has the intended behavior.For illustrative purposes, I’ve created a small job. It updates the customer group to “40” for the customer with account number “4001”. This happens inside a transaction. I’ve also added a breakpoint statement to jump to the debugger inside the transaction.

When running the job the debugger opens:



Now, if we go the SQL Server Management Studio and execute a select statement to validate that the field was correctly updated, we will notice that it still has the old value:



This should not be a surprise, as the transaction has not been committed yet. However; that shouldn’t block our noble purpose. By adding the keyword “nolock” to the query, we instruct SQL to read the uncommitted data, and voila, we get the results we expect:



One additional piece of advice is related to more complicated SQL statements: You have to add the nolock keyword to every joined table.



This can be a true life saver when debugging. In fact I used this heavily the past few weeks where I've been working on the new Warehouse Management module in R3.




==============
Источник: http://blogs.msdn.com/b/mfp/archive/...tted-data.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
Старый 25.06.2014, 21:39   #2  
online
Logger
Участник
Лучший по профессии 2015
Лучший по профессии 2014
 
3,873 / 3123 (112) ++++++++++
Регистрация: 12.10.2004
Адрес: Москва
Записей в блоге: 2
X++:
By adding the keyword “nolock” to the query, we instruct SQL to read the uncommitted data, and voila, we get the results we expect:...
Попробовал бы он такое в оракле провернуть
Фига с два. Но не будем о покойничке....

А еще этот способ бывает полезен, чтобы блокировки лишние не ставить при чтении. Правда с выходом уровнем изоляции транзакций Snapshot isolation мое замечание устарело.
Старый 25.06.2014, 22:39   #3  
Wamr is offline
Wamr
----------------
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
 
1,737 / 858 (32) +++++++
Регистрация: 15.01.2002
Адрес: Москва
Записей в блоге: 7
А можно и настройками запроса
Нажмите на изображение для увеличения
Название: png.png
Просмотров: 320
Размер:	15.3 Кб
ID:	8895
За это сообщение автора поблагодарили: fed (3), Logger (3), Link (4), gl00mie (3).
Старый 28.06.2014, 00:24   #4  
kashperuk is offline
kashperuk
Участник
Аватар для kashperuk
MCBMSS
Соотечественники
Сотрудники Microsoft Dynamics
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии 2011
Лучший по профессии 2009
 
4,361 / 2084 (78) +++++++++
Регистрация: 30.05.2004
Адрес: Atlanta, GA, USA
Да. я обычно просто перед запросами в окне пишу

X++:
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
а то геморно как-то, nolock писать по двести раз
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
mfp: X++ Debugging Tips and Tricks #2 – xSession::xppCallStack() Blog bot DAX Blogs 6 23.11.2015 11:37
mfp: X++ Debugging Tips and Tricks #3–Conditional breakpoints Blog bot DAX Blogs 1 20.11.2013 11:18
mfp: X++ Debugging Tips and Tricks Blog bot DAX Blogs 2 24.09.2013 13:01
mfp: X++ Debugging Tips and Tricks #1 – Breakpoint in Info.add() Blog bot DAX Blogs 1 24.09.2013 11:00
Microsoft Dynamics CRM Team Blog: Data Migration Manager Tips and Tricks Blog bot Dynamics CRM: Blogs 0 02.09.2008 22:05
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

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