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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.