Ignore:
Timestamp:
2008-05-20T10:22:16+12:00 (16 years ago)
Author:
mdewsnip
Message:

(Adding new DB support) Changed the gdbmsource classes to use dbclass instead of gdbmclass, as part of reducing the dependence on gdbm.

File:
1 edited

Legend:

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

    r15162 r15584  
    4444  outconvertclass text_t2ascii;
    4545  err = noError;
    46   if (gdbmptr == NULL) {
     46  if (db_ptr == NULL) {
    4747    // most likely a configuration problem
    4848    logout << text_t2ascii
    49        << "configuration error: lucenegdbmsource contains a null gdbmclass\n\n";
     49       << "configuration error: lucenegdbmsource contains a null dbclass\n\n";
    5050    err = configurationError;
    5151    return true;
     
    5353
    5454  // open the database
    55   gdbmptr->setlogout(&logout);
    56   if (!gdbmptr->opendatabase (gdbm_filename, GDBM_READER, 100, false)) {
    57     // most likely a system problem (we have already checked that the
    58     // gdbm database exists)
     55  db_ptr->setlogout(&logout);
     56  if (!db_ptr->opendatabase (db_filename, DB_READER, 100, false)) {
     57    // most likely a system problem (we have already checked that the database exists)
    5958    logout << text_t2ascii
    60        << "system problem: open on gdbm database \""
    61        << gdbm_filename << "\" failed\n\n";
     59       << "system problem: open on database \"" << db_filename << "\" failed\n\n";
    6260    err = systemProblem;
    6361    return true;
     
    6866    translate_OID (OID, tOID, err, logout);
    6967  infodbclass info;
    70   if (!gdbmptr->getinfo(tOID, info)) {
    71     gdbmptr->closedatabase();  // Important that local library doesn't leave any files open
     68  if (!db_ptr->getinfo(tOID, info)) {
     69    db_ptr->closedatabase();  // Important that local library doesn't leave any files open
    7270    return false;
    7371  }
     
    8280  get_top(tOID, parent_OID);
    8381 
    84   // locate the parent info ingdbm db
    85   if (!gdbmptr->getinfo(parent_OID, info)) {
    86     gdbmptr->closedatabase();  // Important that local library doesn't leave any files open
     82  if (!db_ptr->getinfo(parent_OID, info)) {
     83    db_ptr->closedatabase();  // Important that local library doesn't leave any files open
    8784    return false;
    8885  }
     
    9289 
    9390  doc.clear();
    94   gdbmptr->closedatabase();  // Important that local library doesn't leave any files open
     91  db_ptr->closedatabase();  // Important that local library doesn't leave any files open
    9592  expat_document(full_path_to_doc, ((lucenesearchclass*)textsearchptr)->gdbm_level, text_t(docnum), doc);
    9693  return true;
Note: See TracChangeset for help on using the changeset viewer.