[elephant-devel] Cross-references and SETF SLOT-VALUE
Ian Eslick
eslick at media.mit.edu
Wed Feb 20 22:39:19 UTC 2008
I just looked at the code and it appears to call 'get-con' in all the
right places. The code certainly is structured to do what you suggest
(get controller from the instance slot). I'll chase this down
tonight. Perhaps some recent change created a corner case that the
tests don't catch, although this seems like a pretty significant hole.
FYI - Most of the multi-store ops are in the migration tests and I
don't think people run those separate tests religiously. Perhaps we
should make the standard tests default to running migration between
two stores of the same type. The migration tests are a little slow so
maybe there's a keyword option to turn them off.
Ian
On Feb 20, 2008, at 10:49 AM, Leslie P. Polzer wrote:
>
> 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
>
> _______________________________________________
> elephant-devel site list
> elephant-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/elephant-devel
More information about the elephant-devel
mailing list