
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)