change ForEachRoom to use read-only cursors by default. it can be overridden to
authorNathan Bryant <loanshark@uncensored.citadel.org>
Sun, 29 Jul 2001 20:56:09 +0000 (20:56 +0000)
committerNathan Bryant <loanshark@uncensored.citadel.org>
Sun, 29 Jul 2001 20:56:09 +0000 (20:56 +0000)
still use read/write cursors by doing:

 cdb_begin_transaction();
 ForEachRoom(...);
 cdb_end_transaction();

the only place I found where it appears necessary to do so is check_ref_counts,
so this checkin affects that function too.

citadel/ChangeLog
citadel/housekeeping.c
citadel/room_ops.c

index 4ac00e2daa96a023cfe553b0d498f4cef98b6f4f..4066afaaf8fe6df559498e05faf24d4c3e54a4eb 100644 (file)
@@ -1,4 +1,15 @@
  $Log$
+ Revision 580.14  2001/07/29 20:56:09  nbryant
+ change ForEachRoom to use read-only cursors by default. it can be overridden to
+ still use read/write cursors by doing:
+
+  cdb_begin_transaction();
+  ForEachRoom(...);
+  cdb_end_transaction();
+
+ the only place I found where it appears necessary to do so is check_ref_counts,
+ so this checkin affects that function too.
+
  Revision 580.13  2001/07/29 20:06:33  nbryant
  generate symlinks to .libs in modules directory
 
@@ -2622,4 +2633,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 5cfea179ae84809a1bfb41c9345dd676dbcb213a..c5b33081d7e283a8c840bd761c4bfd9a0166c121 100644 (file)
@@ -109,7 +109,9 @@ void check_ref_counts(void) {
                putfloor(&flbuf, a);
        }
 
+       cdb_begin_transaction();
        ForEachRoom(check_ref_counts_backend, NULL);
+       cdb_end_transaction();
 }      
 
 /*
index 4ba90922c19d2528fade3063a2af1ab511688c74..3566a66ec72b0e0c991e3df9dd7b5ad341324d7f 100644 (file)
@@ -354,7 +354,6 @@ void ForEachRoom(void (*CallBack) (struct quickroom *EachRoom, void *out_data),
        struct quickroom qrbuf;
        struct cdbdata *cdbqr;
 
-       cdb_begin_transaction();
        cdb_rewind(CDB_QUICKROOM);
 
        while (cdbqr = cdb_next_item(CDB_QUICKROOM), cdbqr != NULL) {
@@ -367,7 +366,6 @@ void ForEachRoom(void (*CallBack) (struct quickroom *EachRoom, void *out_data),
                if (qrbuf.QRflags & QR_INUSE)
                        (*CallBack)(&qrbuf, in_data);
        }
-       cdb_end_transaction();
 }