Questions Tagged With ivyhttps://answers.axonivy.com/tags/ivy/?type=rss&user=Dieter%20Staudtquestions tagged <span class="tag">ivy</span>enThu, 08 Jun 2017 07:34:33 -0400Cleanup of cases (and tasks) via an IVY Process causes to Database Deadlockshttps://answers.axonivy.com/questions/2683/cleanup-of-cases-and-tasks-via-an-ivy-process-causes-to-database-deadlocks<p>I refer to the question # “478 - How to cleanup old Cases / Tasks?” with my questions:</p> <ol> <li> <p>“Triggers in the XpertIvySystemDatabase” Among other triggers there is a trigger when deleting cases and when deleting tasks. Because the installing and setup of IVY was done many years ago by a former colleague so my first question is: Were all triggers delivered by AXONIVY?</p> </li> <li> <p>“Cleanup of old Cases and Tasks” We use an timer triggered Ivy Process for the Cleanup with the sql-statement for deleting finished cases: “DELETE FROM IWA_Case WHERE DATEDIFF(dd, EndTimestamp, GETDATE()) &gt; in.TimestampString.</p> </li> </ol> <p>The Timestampstring contains the number of days the finished cases will be stored.</p> <p>For example: “DELETE FROM IWA_Case WHERE DATEDIFF(dd, EndTimestamp, GETDATE()) &gt; 7” will delete all finished cases older than 7 days.</p> <p>As mentioned in my first question, all Delete-Statements in the CASE-DELETE-Trigger and all the nested Delete-Statements in the TASK-DELETE-Trigger will be executed automatically.</p> <p>This causes to Database-Deadlocks – see one Message of our Nagios tool:</p> <p>5 deadlocks detected on LUXDB004</p> <pre><code>spid status loginame hostname blk open_tran dbname cmd waittype waittime last_batch SQLStatement 66 suspended sa_ivy LUXAS004 0 2 IvyDb DELETE 0044 6 Jun 6 2017 08:58:20:460PM DELETE IWA_TaskData FROM IWA_TaskData, deleted WHERE IWA_TaskData.TaskId = deleted.TaskId \n \n 66 suspended LUXAS004 0 0 IvyDb DELETE 00bb 76873 Jun 6 2017 08:58:20:460PM DELETE IWA_TaskData FROM IWA_TaskData, deleted WHERE IWA_TaskData.TaskId = deleted.TaskId \n \n 66 suspended LUXAS004 0 0 IvyDb DELETE 00bb 71822 Jun 6 2017 08:58:20:460PM DELETE IWA_TaskData FROM IWA_TaskData, deleted WHERE IWA_TaskData.TaskId = deleted.TaskId \n \n 66 suspended LUXAS004 0 0 IvyDb DELETE 00bb 49495 Jun 6 2017 08:58:20:460PM DELETE IWA_TaskData FROM IWA_TaskData, deleted WHERE IWA_TaskData.TaskId = deleted.TaskId \n \n 66 suspended LUXAS004 0 0 IvyDb DELETE 00bb 55455 Jun 6 2017 08:58:20:460PM DELETE IWA_TaskData FROM IWA_TaskData, deleted WHERE IWA_TaskData.TaskId = deleted.TaskId \n \n </code></pre> <p>What is wrong? What must we do to avoid this deadlocks?</p> <p>Thanks in advance. Dieter</p>Dieter StaudtThu, 08 Jun 2017 07:34:33 -0400https://answers.axonivy.com/questions/2683/cleanup-of-cases-and-tasks-via-an-ivy-process-causes-to-database-deadlockscasetasksystemdbivy