[elephant-devel] Cross-references and SETF SLOT-VALUE
Leslie P. Polzer
leslie.polzer at gmx.net
Wed Feb 20 15:49:56 UTC 2008
This concerns indexed classes.
Observe:
(asdf:oos 'asdf:load-op 'elephant)
(defpackage #:ele-test (:use :cl :elephant))
(in-package :ele-test)
(defvar *sc2* nil)
(defvar item nil)
(defpclass myclass ()
((testslot :accessor testslot :initarg testslot :index t)))
(open-store '(:BDB "/tmp/db1") :recover t)
(setf *sc2* (open-store '(:BDB "/tmp/db2") :recover t))
(let ((*store-controller* *sc2*))
(setf item (make-instance 'myclass)))
(setf (testslot item) 5)
; ==> Attempted to write object #<MYCLASS oid:100> with home store
; #<BDB-STORE-CONTROLLER /tmp/db2> into store #<BDB-STORE-CONTROLLER /tmp/db1>
(close-store)
(close-store *sc2*)
Intuitively, the SLOT-VALUE writer should have figured out the
correct store controller on its own, by simply looking up ITEM's
home controller. Instead, one has to specify it explicitly:
(let ((*store-controller* *sc2*))
(setf (testslot item) 5)) ; works
Is there any sensible reason for this behaviour?
Is my suspicion correct that multi-store operation is a point that isn't
covered well by the unit tests and experience?
Leslie
More information about the elephant-devel
mailing list