[elephant-devel] Multiple store controllers, with each its own set of classes

Arnaud Betremieux arno at arnoo.net
Tue Sep 20 07:46:40 UTC 2011


Hi all,

I'm trying to use two (BDB) store controllers, each with its own set of
persistent classes. The reason is that I want to be able to modify the
secondary store outside the application (it's read-only within it) and
just plug-in a modified version (close-store, change directory,
open-store) at some point without affecting the rest of the data.

If I just use a let binding to set *store-controller* to the secondary
store around make-instance and get-instances-by-class, everything works,
except I can see the class index is stored in the main store-controller,
which is not good, as I want the secondary store to be independant.

If I set the global *store-controller* to the secondary controller after
having opened both, and even close the first one to make sure before I
call defpclass or any other elephant function, the class index is created
in the right store-controller this time, but I get a new one each time I
open the store (empty btree with a new oid).

I have tried understanding and tracing the related parts of code, but that
part is not exactly easy to dive in for an elephant noob, so I was hoping
that someone familiar with the code could explain what's happening, or
that someone would have a trick for using multiple store controllers in
this fashion.

Thanks a lot,
Arnaud







More information about the elephant-devel mailing list