----------------------------------------
* CRM-15470: MySQL transaction deadlocks with multiple simultaneous recurring contribution updates
https://issues.civicrm.org/jira/browse/CRM-15470
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();
+ }
}
/**