Announcements
No record found.
Hi All,
I am working on application insights, and I have a log for exceptions generated, I want to check if deadlock exception will be shown in that log or not. in order to check this, first I have to generate deadlock exception.
Can anyone let me know how we can we produce the deadlock exception in D365FO using x++
Thanks In Advanceā¦!
internal final class DeadLock_B { static void execute1() { InventSum inventSum; CustTable custTable; ttsBegin; select forUpdate inventSum where inventSum.RecId == 68719638196; sleep(10000); select pessimisticlock custTable where custTable.RecId == 22565424065; custTable.selectForUpdate(true); ttsCommit; } /// <summary> /// Class entry point. The system will call this method when a designated menu /// is selected or when execution starts and this class is set as the startup class. /// </summary> /// <param name = "_args">The specified arguments.</param> public static void main(Args _args) { OA_DeadLock_B::execute1(); } } internal final class DeadLock_A { static void execute2() { InventSum inventSum; CustTable custTable; ttsBegin; select pessimisticlock custTable where custTable.RecId == 22565424065; custTable.selectForUpdate(true); sleep(10000); // Attempt to access Resource X select forUpdate inventSum where inventSum.RecId == 68719638196; ttsCommit; } /// <summary> /// Class entry point. The system will call this method when a designated menu /// is selected or when execution starts and this class is set as the startup class. /// </summary> /// <param name = "_args">The specified arguments.</param> public static void main(Args _args) { OA_DeadLock_A::execute2(); } }
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin DrƔb 445 Most Valuable Professional
AndrƩ Arnaud de Cal... 309 Super User 2026 Season 2
CU29091230-0 192