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) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • contact cache is not getting refreshed
Pages: [1]

Author Topic: contact cache is not getting refreshed  (Read 1459 times)

sushil

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
    • Art of Living
  • CiviCRM version: 3.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.2
contact cache is not getting refreshed
May 11, 2010, 01:49:13 pm
When I try to search contacts using the top left search box, the search results are missing valid contacts, due to the fact these contacts are missing from the contact cache (civicrm_acl_contact_cache)

If I force the cache refresh then the contact shows up in search results.

How and when is the contact cache refreshed?

Thank you

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: contact cache is not getting refreshed
May 11, 2010, 03:11:41 pm

hey casti:

what version? in some earleir versions of 3.0 and 3.1, we did not reset the cache in a few cases. We believe we've got most / all of those places now. Basically whenever a contact is edited (or any thign related to a contact), we reset the cache and recompute as needed

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

sushil

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
    • Art of Living
  • CiviCRM version: 3.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.2
Re: contact cache is not getting refreshed
May 11, 2010, 03:35:52 pm
thank you for the reply. I'm using 3.1.4

sushil

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
    • Art of Living
  • CiviCRM version: 3.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.2
Re: contact cache is not getting refreshed
May 11, 2010, 03:36:54 pm
also the contacts get added or updated into CRM mostly through API

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: contact cache is not getting refreshed
May 11, 2010, 07:29:32 pm

can u give us the code snippet of what calls basically dont cause a cache refresh?

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

sushil

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
    • Art of Living
  • CiviCRM version: 3.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.2
Re: contact cache is not getting refreshed
May 11, 2010, 10:01:12 pm
We use basic public apis to add and update contacts like:
$contact = civicrm_contact_create(&$params);
$contact = civicrm_contact_update(&$params);

and then apis to create/update location and custom fields

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: contact cache is not getting refreshed
May 12, 2010, 07:44:54 am

Can you create a small unit test case using the api's which reproduces the issue? that will help us isolate and fix the problem, in addition to increasing our test coverage

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

sushil

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
    • Art of Living
  • CiviCRM version: 3.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.2
Re: contact cache is not getting refreshed
May 12, 2010, 02:05:35 pm
Hi Donald,

Unfortunately I never dealt with test cases before. I can provide the code if needed.

Thanks
Casti

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: contact cache is not getting refreshed
May 12, 2010, 04:02:33 pm

hey casti:

lots of examples of tst cases here:

http://svn.civicrm.org/civicrm/branches/v3.1/tests/phpunit/

Setting up a test environment is described here:

http://wiki.civicrm.org/confluence/display/CRM/Testing

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • contact cache is not getting refreshed

This forum was archived on 2017-11-26.