Error while loading / saving taxonomy term on external DB I have 2 different Drupal bootstraps with shared DB, and I'm switching from the "slave" bootstrap with db_set_active('shared') when need to work with the shared DB.

example:

function test_function(){
  db_set_active('shared');
  $term_tid = array_keys(taxonomy_get_term_by_name($term, $vocabulary = 'vocab'));
  if (!$term_tid){
   $term = new stdClass();
   $term-&gt;name = $term;
   $term-&gt;vid = 1;
   taxonomy_term_save($term);
  }
  db_set_active('default');
}


while using either one of the taxonomy functions, taxonomy_get_term_by_name or taxonomy_term_save giving me this error:


  PHP Fatal error:  Class name must be a valid object or a string in
  /home/user/www/includes/common.inc on line 7618


any help appriciated!
SOLVED!
after long head bashing, what fixed this for me was to manually empty the "cache" tables with PMA on the "shared" DB!

important to notice that Drupal native Clear Caches didn't do the work, it had to be removed from the DB!