* database_sleepycat.c: cdb_truncate() no longer encapsulated in a
authorArt Cancro <ajc@citadel.org>
Mon, 23 May 2005 19:33:57 +0000 (19:33 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 23 May 2005 19:33:57 +0000 (19:33 +0000)
  transaction.  Truncating a database in Citadel is always synchronous,
  and with big tables (such as when the full text indexer is switched off
  or reinitialized) it was running out of memory.

citadel/ChangeLog
citadel/database_sleepycat.c

index f28fbb9a6c4f990b1448d215ae0b9af181b4d019..7d417c34f093506b65a101b5c1b713e28fb2cd46 100644 (file)
@@ -1,7 +1,3 @@
- $Log$
- Revision 647.21  2005/05/23 19:31:52  ajc
- * test
-
  Revision 647.20  2005/05/23 19:26:04  ajc
  * Move the location of the "enable full text index" configuration item to
    a new location.  Reusing an old location was a stupid idea because old
index 1ce1e1b2b5cdee8ef917b2e7a9a0577d0921ad91..1e2b4f6cebaa92f8f978952dbdbdb13117b22c3b 100644 (file)
@@ -873,7 +873,7 @@ void cdb_end_transaction(void)
  */
 void cdb_trunc(int cdb)
 {
-       //DB_TXN *tid;
+       /* DB_TXN *tid; */
        int ret;
        u_int32_t count;
 
@@ -886,14 +886,14 @@ void cdb_trunc(int cdb)
                             "attempt to write during r/o cursor");
 
              retry:
-               //txbegin(&tid);
+               /* txbegin(&tid); */
 
                if ((ret = dbp[cdb]->truncate(dbp[cdb], /* db */
                                              NULL,     /* transaction ID */
                                              &count,   /* #rows deleted */
                                              0))) {    /* flags */
                        if (ret == DB_LOCK_DEADLOCK) {
-                               //txabort(tid);
+                               /* txabort(tid); */
                                goto retry;
                        } else {
                                lprintf(CTDL_EMERG,
@@ -902,7 +902,7 @@ void cdb_trunc(int cdb)
                                abort();
                        }
                } else {
-                       //txcommit(tid);
+                       /* txcommit(tid); */
                }
        }
 }