Update of /project/elephant/cvsroot/elephant/src/elephant In directory clnet:/tmp/cvs-serv23282/src/elephant
Modified Files: controller.lisp package.lisp Log Message: User parameter if; deadlock detector param support
--- /project/elephant/cvsroot/elephant/src/elephant/controller.lisp 2007/02/14 04:36:10 1.32 +++ /project/elephant/cvsroot/elephant/src/elephant/controller.lisp 2007/02/14 17:41:29 1.33 @@ -99,6 +99,15 @@ dep-list))
;; +;; PER-USER INSTALLATION PARAMETERS +;; + +(defun get-user-configuration-parameter (name) + (elephant-system::get-config-option + name + (asdf:find-system :elephant))) + +;; ;; COMMON STORE CONTROLLER FUNCTIONALITY ;;
@@ -128,6 +137,35 @@ (for garbage collection,) et cetera."))
;; +;; Per-controller instance caching +;; + +(defun cache-instance (sc obj) + "Cache a persistent object with the controller." + (declare (type store-controller sc)) + (ele-with-lock ((instance-cache-lock sc)) + (setf (get-cache (oid obj) (instance-cache sc)) obj))) + +(defun get-cached-instance (sc oid class-name) + "Get a cached instance, or instantiate!" + (declare (type store-controller sc) + (type fixnum oid)) + (let ((obj (get-cache oid (instance-cache sc)))) + (if obj obj + ;; Should get cached since make-instance calls cache-instance + (make-instance (handle-legacy-classes class-name nil) + :from-oid oid :sc sc)))) + +(defmethod flush-instance-cache ((sc store-controller)) + "Reset the instance cache (flush object lookups). Useful + for testing. Does not reclaim existing objects so there + will be duplicate instances with identical functionality" + (ele-with-lock ((instance-cache-lock sc)) + (setf (instance-cache sc) + (make-cache-table :test 'eql)))) + + +;; ;; Database versioning ;;
@@ -240,35 +278,6 @@ (defun string-pair->symbol (name) (intern (string-upcase (cdr name)) (car name)))
-;; -;; Per-controller instance caching -;; - -(defun cache-instance (sc obj) - "Cache a persistent object with the controller." - (declare (type store-controller sc)) - (ele-with-lock ((instance-cache-lock sc)) - (setf (get-cache (oid obj) (instance-cache sc)) obj))) - -(defun get-cached-instance (sc oid class-name) - "Get a cached instance, or instantiate!" - (declare (type store-controller sc) - (type fixnum oid)) - (let ((obj (get-cache oid (instance-cache sc)))) - (if obj obj - ;; Should get cached since make-instance calls cache-instance - (make-instance (handle-legacy-classes class-name nil) - :from-oid oid :sc sc)))) - -(defmethod flush-instance-cache ((sc store-controller)) - "Reset the instance cache (flush object lookups). Useful - for testing. Does not reclaim existing objects so there - will be duplicate instances with identical functionality" - (ele-with-lock ((instance-cache-lock sc)) - (setf (instance-cache sc) - (make-cache-table :test 'eql)))) - - ;; ================================================================================ ;; ;; BACKEND STORE CONTROLLER PROTOCOL --- /project/elephant/cvsroot/elephant/src/elephant/package.lisp 2007/02/08 23:07:19 1.12 +++ /project/elephant/cvsroot/elephant/src/elephant/package.lisp 2007/02/14 17:41:29 1.13 @@ -36,6 +36,7 @@ #:controller-symbol-cache #:controller-symbol-id-cache #:controller-fast-symbols-p #:optimize-storage + #:get-user-configuration-parameter
#:upgrade