Changeset 13780


Ignore:
Timestamp:
2007-01-24T16:48:54+13:00 (17 years ago)
Author:
mdewsnip
Message:

GLI/LOCAL LIBRARY: To prevent the problems with the GLI being unable to install newly built collections because the local library is holding files open, much more care needs to be taken to close files (typically the GDBM database and the MG/MGPP index files) after use. Fixed a lot of places where files were being left open.

Location:
trunk/gsdl/src/colservr
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/colservr/browsefilter.cpp

    r11259 r13780  
    304304  }
    305305
     306  gdbmptr->closedatabase();  // Important that local library doesn't leave any files open
    306307  response.numDocs = numDocs;
    307308  response.isApprox = Exact;
  • trunk/gsdl/src/colservr/gdbmsource.cpp

    r10414 r13780  
    159159  infodbclass info;
    160160  OIDout = gdbmptr->translate_OID (OIDin, info);
     161  gdbmptr->closedatabase();  // Important that local library doesn't leave any files open
    161162  return true;
    162163}
     
    314315    ++fields_here;
    315316  }
     317
     318  gdbmptr->closedatabase();  // Important that local library doesn't leave any files open
    316319  return true;
    317320}
     
    348351    translate_OID (OID, tOID, err, logout);
    349352  infodbclass info;
    350   if (!gdbmptr->getinfo(tOID, info)) return false;
     353  if (!gdbmptr->getinfo(tOID, info)) {
     354    gdbmptr->closedatabase();  // Important that local library doesn't leave any files open
     355    return false;
     356  }
    351357 
    352358  if (info["hastxt"].getint() == 1) {
     
    360366                   defaultlanguage, collection, docnum, doc);
    361367  }
     368
     369  gdbmptr->closedatabase();  // Important that local library doesn't leave any files open
    362370  return true;
    363371}
  • trunk/gsdl/src/colservr/lucenegdbmsource.cpp

    r9916 r13780  
    6868    translate_OID (OID, tOID, err, logout);
    6969  infodbclass info;
    70   if (!gdbmptr->getinfo(tOID, info)) return false;
    71  
     70  if (!gdbmptr->getinfo(tOID, info)) {
     71    gdbmptr->closedatabase();  // Important that local library doesn't leave any files open
     72    return false;
     73  }
     74
    7275  if (info["hastxt"].getint() == 0) { // there is no text for this section
    7376    return false; // true??
     
    8083 
    8184  // locate the parent info ingdbm db
    82   if (!gdbmptr->getinfo(parent_OID, info)) return false;
    83  
     85  if (!gdbmptr->getinfo(parent_OID, info)) {
     86    gdbmptr->closedatabase();  // Important that local library doesn't leave any files open
     87    return false;
     88  }
     89
    8490  text_t archive_dir = info["assocfilepath"];
    8591  text_t full_path_to_doc = filename_cat(collectdir, "index", "text", archive_dir, "doc.xml");
    8692 
    8793  doc.clear();
     94  gdbmptr->closedatabase();  // Important that local library doesn't leave any files open
    8895  expat_document(full_path_to_doc, ((lucenesearchclass*)textsearchptr)->gdbm_level, text_t(docnum), doc);
    8996  return true;
  • trunk/gsdl/src/colservr/lucenequeryfilter.cpp

    r13063 r13780  
    261261  }
    262262
     263  gdbmptr->closedatabase();  // Important that local library doesn't leave any files open
    263264  response.numDocs = queryresults.docs_matched;
    264265  response.isApprox = queryresults.is_approx;
  • trunk/gsdl/src/colservr/mgppqueryfilter.cpp

    r10954 r13780  
    250250  }
    251251
     252  gdbmptr->closedatabase();  // Important that local library doesn't leave any files open
    252253  response.numDocs = queryresults.docs_matched;
    253254  response.isApprox = queryresults.is_approx;
  • trunk/gsdl/src/colservr/mgppsearch.cpp

    r12869 r13780  
    212212  }
    213213  // clean up
     214  unload_database();  // Important that local library doesn't leave any files open
    214215  delete []indexname;
    215216  return true;
     
    270271    queryresult.terms.push_back(term);
    271272    queryresult.orgterms.push_back(term);
    272 
    273   }
     273  }
     274
    274275  // clean up
     276  unload_database();  // Important that local library doesn't leave any files open
    275277  delete []indexname;
    276278
  • trunk/gsdl/src/colservr/mgqueryfilter.cpp

    r12314 r13780  
    445445  }
    446446
     447  gdbmptr->closedatabase();  // Important that local library doesn't leave any files open
    447448  response.numDocs = queryresults.docs_matched;
    448449  response.isApprox = queryresults.is_approx;
  • trunk/gsdl/src/colservr/mgsearch.cpp

    r9937 r13780  
    336336    // retrieve the results
    337337    getresults (queryparams, queryresults);
     338    unload_database();  // Important that local library doesn't leave any files open
    338339    return true;
    339340  }
     
    561562  }
    562563
     564  unload_database();  // Important that local library doesn't leave any files open
    563565  return (bool)databaseloaded;
    564566}
Note: See TracChangeset for help on using the changeset viewer.