[elephant-devel] Transient slots in non-persistent objects

Ben ben at medianstrip.net
Wed Oct 20 15:42:04 UTC 2004


At the moment, there is no way to make transient slots on ordinary
objects.  On first glance, I don't know how to support non-standard
slot options in the standard slot metaclass.  The serializer uses
"slot-value", not the accessors, so I think unless OpenMCL calls
"slot-value-using-class" (which I don't remember off the top of my
head) you'll have a hard time overriding that.

There are some other kludges I can think of, but they are just
kludges, roughly equivalent to the one you've suggested.  One thing
you can do is keep track of the objects which hold OS resources.  For
example, you can put something in initialize-instance which adds the
instance to a collection stored somewhere on the class object.  (EQ
hashtables are probably good for this.)  Then you can have a method on
the class object which walks the collection and NULLs the offending
slots.  Call this before shutdown / save.

Honestly, your usage pattern wasn't one I had in mind when Elephant
was designed.  Some of your concerns might be fixed by
"single-user-mode", but unfortunately given time constraints that
probably won't get done until at least the end of November.  Can I ask
what is wrong with using persistent objects?  Is it caching (DB hits
on read), DB hits on write, or lazy loading?

You might consider flipping various flags on the DB for performance,
like DB_PRIVATE, DB_TXN_NO_SYNC, etc.

take care, B

On Wed, 20 Oct 2004, Peter Bengtson wrote:

> Hi,
>
> I'm developing a server application in OpenMCL where I'm using Elephant to 
> store one single (large) object, read into memory at startup and dumped back 
> to the DB at shutdown. Thus, I do not use persistent CLOS objects, only 
> standard ones.
>
> The data structure is heavily circular, and contains CLOS objects with slots 
> pointing to OS resources, such as sockets. I don't wish to save these slots - 
> they are transient.
>
> Is there a way to specify this behaviour? I guess only the serializer needs 
> to be modified. It is of course possible work around it with an :AROUND 
> method on the slots in question and a special variable which will make the 
> accessor functions simply return NIL, but this is kludgy and adds unnecessary 
> overhead.
>
> 	/ Peter
>
>
> _______________________________________________
> 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