From: pratikshad Date: Fri, 30 Jan 2015 07:54:25 +0000 (+1000) Subject: Fixed issue of deadlock CRM-15470 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1ad799fac8340302b6c2cfdc97a845d647aa948d;p=civicrm-core.git Fixed issue of deadlock CRM-15470 ---------------------------------------- * CRM-15470: MySQL transaction deadlocks with multiple simultaneous recurring contribution updates https://issues.civicrm.org/jira/browse/CRM-15470 --- diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index e156a526b9..74603d8570 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -270,7 +270,13 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { if ($recordTypeID) { $activityContact->record_type_id = $recordTypeID; } - $activityContact->delete(); + + //let's check if activity contact record exits and then delete. + //looks like delete leads to deadlock when multiple simultaneous + //requests are done. CRM-15470 + if ($activityContact->find()) { + $activityContact->delete(); + } } /**