X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FBAO%2FGroupContactCache.php;h=a1cf6d594e87940aa3b09b1a5c1415bf47c97f06;hb=51589e7d36c8c5c9b4915b458bb2bad1b1dff6c4;hp=cb9e1180423959d1f352a0995a3acd1518cd21c9;hpb=776ff7a00ca98cd3f668e43e4419c62791b1110f;p=civicrm-core.git diff --git a/CRM/Contact/BAO/GroupContactCache.php b/CRM/Contact/BAO/GroupContactCache.php index cb9e118042..a1cf6d594e 100644 --- a/CRM/Contact/BAO/GroupContactCache.php +++ b/CRM/Contact/BAO/GroupContactCache.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.6 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2014 | + | Copyright CiviCRM LLC (c) 2004-2015 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -28,7 +28,7 @@ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2014 + * @copyright CiviCRM LLC (c) 2004-2015 * $Id$ * */ @@ -434,8 +434,7 @@ WHERE id = %1 } // grab a lock so other processes dont compete and do the same query - $lockName = "civicrm.group.{$groupID}"; - $lock = new CRM_Core_Lock($lockName); + $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire("data.core.group.{$groupID}"); if (!$lock->isAcquired()) { // this can cause inconsistent results since we dont know if the other process // will fill up the cache before our calling routine needs it. @@ -543,7 +542,7 @@ WHERE civicrm_group_contact.status = 'Added' "INSERT IGNORE INTO civicrm_group_contact_cache (contact_id, group_id) SELECT DISTINCT $idName, group_id FROM $tempTable "); - CRM_Core_DAO::executeQuery(" DROP TABLE $tempTable"); + CRM_Core_DAO::executeQuery(" DROP TEMPORARY TABLE $tempTable"); } self::updateCacheTime($groupIDs, $processed);