[elephant-cvs] CVS elephant/src/db-bdb

ieslick ieslick at common-lisp.net
Wed Feb 22 21:03:47 UTC 2006


Update of /project/elephant/cvsroot/elephant/src/db-bdb
In directory common-lisp:/tmp/cvs-serv18474/src/db-bdb

Modified Files:
	bdb-collections.lisp bdb-controller.lisp 
Log Message:

Quick fix for config.lisp not having a package designator.  Also my tweaks
to fix a BDB bug, adding transacctions to btree writes for increased safety
and various tweaks I made trying to fix the slot-boundp bug in indexing-redef-class



--- /project/elephant/cvsroot/elephant/src/db-bdb/bdb-collections.lisp	2006/02/22 04:40:57	1.4
+++ /project/elephant/cvsroot/elephant/src/db-bdb/bdb-collections.lisp	2006/02/22 21:03:47	1.5
@@ -56,22 +56,24 @@
 
 (defmethod (setf get-value) (value key (bt bdb-btree))
   (declare (optimize (speed 3) (safety 0) (space 0)))
-  (with-buffer-streams (key-buf value-buf)
-    (buffer-write-int (oid bt) key-buf)
-    (serialize key key-buf)
-    (serialize value value-buf)
-    (db-put-buffered (controller-btrees (get-con bt)) 
-		     key-buf value-buf
-		     :auto-commit *auto-commit*)
-    value))
+  (with-transaction (:store-controller (get-con bt))
+    (with-buffer-streams (key-buf value-buf)
+      (buffer-write-int (oid bt) key-buf)
+      (serialize key key-buf)
+      (serialize value value-buf)
+      (db-put-buffered (controller-btrees (get-con bt)) 
+		       key-buf value-buf
+		       :auto-commit *auto-commit*)
+      value)))
 
 (defmethod remove-kv (key (bt bdb-btree))
   (declare (optimize (speed 3) (space 0) (safety 0)))
-  (with-buffer-streams (key-buf)
-    (buffer-write-int (oid bt) key-buf)
-    (serialize key key-buf)
-    (db-delete-buffered (controller-btrees (get-con bt)) 
-			key-buf	:auto-commit *auto-commit*)))
+  (with-transaction (:store-controller (get-con bt))
+    (with-buffer-streams (key-buf)
+      (buffer-write-int (oid bt) key-buf)
+      (serialize key key-buf)
+      (db-delete-buffered (controller-btrees (get-con bt)) 
+			  key-buf :auto-commit *auto-commit*))))
 
 ;; Secondary indices
 
--- /project/elephant/cvsroot/elephant/src/db-bdb/bdb-controller.lisp	2006/02/22 17:15:49	1.4
+++ /project/elephant/cvsroot/elephant/src/db-bdb/bdb-controller.lisp	2006/02/22 21:03:47	1.5
@@ -150,8 +150,7 @@
 ;;
 
 (defmethod persistent-slot-reader ((sc bdb-store-controller) instance name)
-  (declare (optimize (speed 3) (safety 1) (space 1))
-	   (type string name))
+;;  (declare (optimize (speed 3) (safety 1) (space 1)))
   (with-buffer-streams (key-buf value-buf)
     (buffer-write-int (oid instance) key-buf)
     (serialize name key-buf)
@@ -164,8 +163,8 @@
 	  (error 'unbound-slot :instance instance :name name)))))
 
 (defmethod persistent-slot-writer ((sc bdb-store-controller) new-value instance name)
-  (declare (optimize (speed 3) (safety 1) (space 1))
-	   (type string name))
+;;  (declare (optimize (speed 3) (safety 1) (space 1)))
+;;  (format t "psw -- sc: ~A  ct: ~A ac: ~A~%" *store-controller* *current-transaction* *auto-commit*)
   (with-buffer-streams (key-buf value-buf)
     (buffer-write-int (oid instance) key-buf)
     (serialize name key-buf)
@@ -177,8 +176,7 @@
     new-value))
 
 (defmethod persistent-slot-boundp ((sc bdb-store-controller) instance name)
-  (declare (optimize (speed 3) (safety 1) (space 1))
-	   (type string name))
+;;  (declare (optimize (speed 3) (safety 1) (space 1)))
   (with-buffer-streams (key-buf value-buf)
     (buffer-write-int (oid instance) key-buf)
     (serialize name key-buf)
@@ -187,8 +185,7 @@
       (if buf t nil))))
 
 (defmethod persistent-slot-makunbound ((sc bdb-store-controller) instance name)
-  (declare (optimize (speed 3) (safety 1) (space 1))
-	   (type string name))
+;;  (declare (optimize (speed 3) (safety 1) (space 1)))
   (with-buffer-streams (key-buf)
     (buffer-write-int (oid instance) key-buf)
     (serialize name key-buf)




More information about the Elephant-cvs mailing list