[elephant-cvs] CVS elephant/src/elephant
ieslick
ieslick at common-lisp.net
Fri Jan 19 21:03:30 UTC 2007
Update of /project/elephant/cvsroot/elephant/src/elephant
In directory clnet:/tmp/cvs-serv4428/src/elephant
Modified Files:
controller.lisp package.lisp
Log Message:
Added missing file; Henrik's fixes to ele-bdb and clsql cursor-pset
--- /project/elephant/cvsroot/elephant/src/elephant/controller.lisp 2006/12/16 19:35:10 1.17
+++ /project/elephant/cvsroot/elephant/src/elephant/controller.lisp 2007/01/19 21:03:30 1.18
@@ -198,7 +198,7 @@
(class-root :reader controller-class-root
:documentation "This should be a persistent indexed btree instantiated by the backend")
;; Upgradable serializer strategy
- (version :accessor controller-version :initform nil)
+ (version :accessor controller-version-cached :initform nil)
(serializer-version :accessor controller-serializer-version :initform nil)
(serialize :accessor controller-serialize :initform nil)
(deserialize :accessor controller-deserialize :initform nil)
@@ -230,11 +230,16 @@
(defvar *restricted-properties* '(:version)
"Properties that are not user manipulable")
-(defgeneric controller-version ((sc store-controller))
- (:documentation "Return the elephant version of this controller - should not
- require the serializer to operate as it may be used to determine
- the serializer version used to read the DB. This has to be valid
- prior to the DB being opened."))
+(defmethod controller-version ((sc store-controller))
+ (let ((version (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 (controller-version-cached sc) (read stream)))
+ (with-open-file (stream path :direction :output)
+ (setf (controller-version-cached sc)
+ (write *elephant-code-version* :stream stream))))))))
(defun prior-version-p (v1 v2)
"Is v1 an equal or earlier version than v2"
--- /project/elephant/cvsroot/elephant/src/elephant/package.lisp 2006/12/16 19:35:10 1.4
+++ /project/elephant/cvsroot/elephant/src/elephant/package.lisp 2007/01/19 21:03:30 1.5
@@ -29,7 +29,8 @@
#:*elephant-lib-path* #:*elephant-code-version*
#:store-controller #:controller-root #:controller-class-root
- #:controller-version #:controller-serialize #:controller-deserialize
+ #:controller-version #:controller-serializer-version
+ #:controller-serialize #:controller-deserialize
#:open-store #:close-store #:with-open-store
#:add-to-root #:get-from-root #:remove-from-root #:root-existsp
#:get-cached-instance #:flush-instance-cache
More information about the Elephant-cvs
mailing list