[ZODB-Dev] Storing persistent and non-persistent data together

Christian Robottom Reis kiko at async.com.br
Mon Nov 1 09:56:49 EST 2004


On Sun, Oct 31, 2004 at 01:22:09PM -0600, Eric Mangold wrote:
> I have a client-server application. On the server side I have
> a User class that stores account information (persistent) and also
> other related things, such as a reference to the client-side
> of the connection when the client is logged in (network-depndent
> and thus non-persistent).
> 
> These things logically go together, and I would like to keep them
> together inside my User class which I would like to be a sub-class
> of Persistent.

This has been discussed before on ZODB-dev; essentially, you would need
to use 'volatile' attributes (like _v_); however, these present problems
of their own, since they can disappear at certain transaction
boundaries.

There was discussion on this being slightly modified, but I don't think
anything concrete came out of it.

> Is this possible? If not, what are the alternatives to storing
> logically related, persistent and non-persistent, references in
> the context of the ZODB?

I don't know, because it would depend on your application. You could
just store a global container (BTree, set, etc) that somehow referenced
your objects and your non-persistent data; the container would not be
persistent.

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331


More information about the ZODB-Dev mailing list