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

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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
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, время: 12:32.