web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Enable tracing for deadlock in AX client for all users

(0) ShareShare
ReportReport
Posted on by 11,633

Hi All,

One of my client have recently experienced frequent deadlocks in SQL, so in order to track it from AX client and which user is causing this, I am thinking of enable deadlock tracing from AX client. As I need to enable it for all users, I have written a below X++ job to do that. I am going to do this in LIVE environment of client, so just wanted to know if anyone have any experience of enabling this flag before and is there any performance impact? Please note that I am just enabling just one flag related to Deadlocks which write the data in database(SysTraceSQLTable is the name of the table I guess), so I don't there would be any performance impact but just wanted to double check. Also, let me know if there is any modifications required in the below job.

static void enableTracingForDeadLocks(Args _args)
{
boolean enable = true;
UserInfo userInfo;

#LOCALMACRO.FLAG_SQLTrace (1 << 8) #ENDMACRO
#LOCALMACRO.FLAG_TraceInfoDeadLockTable (1 << 15) #ENDMACRO
;

ttsbegin;
while select forupdate userInfo
{
userInfo.DebugInfo = userInfo.DebugInfo | #FLAG_SQLTrace;
userInfo.TraceInfo = userInfo.TraceInfo | #FLAG_TraceInfoDeadLockTable;

userInfo.update();
}
ttscommit;
}

Thanks,

Baber.

*This post is locked for comments

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans