Update of /project/elephant/cvsroot/elephant/src/db-bdb In directory clnet:/tmp/cvs-serv22773/src/db-bdb
Modified Files: bdb-controller.lisp Log Message: Repairing the use of the serializer for the SQL side
--- /project/elephant/cvsroot/elephant/src/db-bdb/bdb-controller.lisp 2007/01/19 21:03:29 1.15 +++ /project/elephant/cvsroot/elephant/src/db-bdb/bdb-controller.lisp 2007/01/26 14:41:08 1.16 @@ -271,4 +271,20 @@ :free-space free-space))) (values (deserialize end ctrl))))
+;; Store the serializer version. For BDB this can be in a file; different backends +;; may require a different approach. +(defmethod database-version ((sc bdb-store-controller)) + "A version determination for a given store + controller that is independant of the serializer as the + serializer is dispatched based on the code version which is a + list of the form '(0 6 0)" + (let ((version (elephant::controller-version-cached sc))) + (if version version + (let ((path (make-pathname :name "VERSION" :defaults (second (controller-spec sc))))) + (if (probe-file path) + (with-open-file (stream path :direction :input) + (setf (elephant::controller-version-cached sc) (read stream))) + (with-open-file (stream path :direction :output) + (setf (elephant::controller-version-cached sc) + (write *elephant-code-version* :stream stream))))))))