[elephant-devel] a bug when not use elephant:*store-controller* when close-store
Alex Mizrahi
killerstorm at newmail.ru
Wed Jul 28 07:36:03 UTC 2010
LPP> the documentation for close-store says:
LPP> If you pass a custom store controller,
LPP> you are responsible for setting it to NIL.
What is "it" in this context"? I think it is pretty hard to read this as
"you are responsible for setting elephant:*current-controller* to NIL".
LPP> Do you think this behavior should be changed?
I think so -- behaviour of open-store/close-store is not symmetric and is
pretty ugly. I don't know what is a right fix, though...
A simple solution would be to set *current-controller* to NIL in close-store
if passed custom store matches *current-controller*.
I think it should work in all cases except when *current-controller* is
re-bound, e.g. via with-store.
Better solution would be to prevent open-store from setting *current-store*
at all. E.g. with a parameter:
(defparameter *foo* (open-store '(:BDB ...) :set-default NIL)
Or we can set this behaviour globally, e.g. if we set *current-controller*
to something other than NIL or a store:
(setf *current-controller* :no-default-controller)
this will prevent open-store from overwriting it.
More information about the elephant-devel
mailing list