]> code.citadel.org Git - citadel.git/commitdiff
* A few final touches to the Sleepycat DB back-end
authorArt Cancro <ajc@citadel.org>
Sat, 9 Dec 2000 06:20:06 +0000 (06:20 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 9 Dec 2000 06:20:06 +0000 (06:20 +0000)
citadel/ChangeLog
citadel/serv_vandelay.c
citadel/sysdep.c

index f93ef6058ba5bf5a22e521d03b9662ad9c9f1d69..8a7fa0a6fe3bbe0ea9c5a55811ce715ed7ed10e1 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 573.44  2000/12/09 06:20:06  ajc
+ * A few final touches to the Sleepycat DB back-end
+
  Revision 573.43  2000/12/08 17:06:33  ajc
  * Wrap txn_begin and txn_end in S_DATABASE mutex
 
@@ -2197,4 +2200,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index d6d90cf9dcbb50efacbb3a9e3f5776c3352e730b..ce1ca76da2e4033a89d67f6b1832bdf6f6c1f772 100644 (file)
@@ -514,6 +514,18 @@ void artv_do_import(void) {
                else if (!strcasecmp(buf, "visit")) artv_import_visit();
                else if (!strcasecmp(buf, "message")) artv_import_message();
                else break;
+
+               /* Yes, this is correct: end *then* begin.  Since we're in a
+                * session command loop, there's already a transaction in
+                * progress.  We want to end it and then begin a new one at the
+                * end of every object import, otherwise the entire import
+                * logs as a single transaction.  Not only would that be a bad
+                * idea, but it'll actually crash the db when importing very
+                * large files.
+                */
+               cdb_end_transaction();
+               cdb_begin_transaction();
+
        }
        lprintf(7, "Invalid keyword <%s>.  Flushing input.\n", buf);
        while (client_gets(buf), strcmp(buf, "000"))  ;;
index 23ef843700911978d09b5d13f5b04f844fed16ad..4ec3c514e2739ed1363793b57dece5abb0615ffb 100644 (file)
@@ -927,6 +927,7 @@ int main(int argc, char **argv)
        lprintf(7, "Loading citadel.config\n");
        get_config();
 
+
        /*
         * Do non system dependent startup functions.
         */
@@ -952,11 +953,13 @@ int main(int argc, char **argv)
         * Load any server-side modules (plugins) available here.
         */
        lprintf(7, "Initializing loadable modules\n");
+       cdb_begin_transaction();
        if ((moddir = malloc(strlen(bbs_home_directory) + 9)) != NULL) {
                sprintf(moddir, "%s/modules", bbs_home_directory);
                DLoader_Init(moddir);
                free(moddir);
        }
+       cdb_end_transaction();
 
        /*
         * The rescan pipe exists so that worker threads can be woken up and
@@ -992,6 +995,8 @@ int main(int argc, char **argv)
                }
        }
 
+
+
        /*
         * Create the housekeeper thread
         */