Notifications
Announcements
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Abhilash Warrier 763 Super User 2025 Season 2
André Arnaud de Cal... 413 Super User 2025 Season 2
Martin Dráb 284 Most Valuable Professional