[elephant-devel] Deferred schema sync

Ian Eslick eslick at media.mit.edu
Wed Sep 9 20:41:24 UTC 2009


Hi Leslie,

The policies here have been a thorn in the design for some time.  The  
first version of schema sync provided lots of configuration options  
for sync policies, the second tried to provide a clean default policy;  
but I have also had this redefine before open sync problem.

The idea is that the code should be the master and should update the  
DB when the DB is connected.  This would mean a walk of the class  
schema table and checking if there is anything in memory already which  
it should sync to.  This should be configurable for anyone doing the  
with-open-store approach to opening/closing stores frequently (a rare  
model, I believe).

However, we want lots of seat belts for the 'code as master' model as  
a redefinition that drops or renames a slot should never drop data  
(this is working now, correct?).

Ian



On Aug 4, 2009, at 11:28 AM, Leslie P. Polzer wrote:

>
> (open-store *testbdb-spec*)
>
> (defpclass foobar () ())
>
> (make-instance 'foobar)
>
> (close-store)
>
> (defpclass foobar ()
>  ((slot :accessor slot :initform nil))
>  (:index t))
>
> (open-store *testbdb-spec*)
>
> (describe (car (get-instances-by-class 'foobar)))
>
> #<FOOBAR oid:2>
>  [standard-object]
>
> Slots with :DATABASE allocation:
>  SLOT  = #<unbound slot>
> Slots with :INSTANCE allocation:
>  OID   = 2
>  SPEC  = (:BDB "/home/sky/mystic/packages/elephant-1.0/tests/testdb/")
>
> (defpclass foobar ()
>  ((slot :accessor slot :initform nil))
>  (:index t))
>
> Synchronizing FOOBAR in ...
> #<PERSISTENT-METACLASS FOOBAR>
>
>
> Bottom line: class schemas changed while a store is closed
> won't sync when that store is opened later.
>
> There are several ways to approach this. We could just sync
> all db classes when a store is opened or take note of which
> redefined classes have synced to which stores.
>
> Opinions?
>
>  Leslie
>
> -- 
> http://www.linkedin.com/in/polzer
>
>
> _______________________________________________
> 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