CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Registering for an event causes mysql server to hang
Pages: [1]

Author Topic: Registering for an event causes mysql server to hang  (Read 408 times)

jaapjansma

  • I post frequently
  • ***
  • Posts: 247
  • Karma: 9
    • CiviCoop
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.4
Registering for an event causes mysql server to hang
September 29, 2015, 07:12:10 am
Hey,

I have a problem. At a large installation of CiviCRM we have a problem that people are being signed up as a participant for an event. But when more people are doing that the mysql server gets slow and ends in a transaction lock.

Investigating the problem I discover that the smart groups are being rebuild which is in this installation something which causes many headaches. But I am wondering why on earth the the Group Contact Cahce is empties as soon as someone is registered as participant.

Code: [Select]
File CRM/Event/BAO/Participant.php

class CRM_Event_BAO_Participant extends CRM_Event_DAO_Participant {
    ...
   static function &add(&$params) {
      ...
      // reset the group contact cache for this group
      CRM_Contact_BAO_GroupContactCache::remove();

      if (CRM_Utils_Array::value('id', $params)) {
        CRM_Utils_Hook::post('edit', 'Participant', $participantBAO->id, $participantBAO);
      }
      else {
        CRM_Utils_Hook::post('create', 'Participant', $participantBAO->id, $participantBAO);
      }
    return $participantBAO;
  }
...

See also this line on github: https://github.com/civicrm/civicrm-core/blame/master/CRM/Event/BAO/Participant.php#L146

Is there a reason to empty the group contact cache?
Developer at Edeveloper / CiviCoop

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Registering for an event causes mysql server to hang

This forum was archived on 2017-11-26.