[ZODB-Dev] A koan: persistent object with no container

Jim Fulton jim at zope.com
Fri Nov 14 18:58:16 EST 2008


On Nov 14, 2008, at 6:51 PM, Shane Hathaway wrote:

> Jim Fulton wrote:
>> On Nov 14, 2008, at 6:16 PM, Paul Winkler wrote:
>>
>>> If I instantiate a subclass of Persistent, but I don't ever assign  
>>> it
>>> as an attribute on the root (or any other Persistent instance) ...
>>> then what happens to my instance when the transaction commits?
>>>
>>> A) it's saved in the ZODB, but not reachable?
>>> or
>>> B) it's never saved at all?
>>> or
>>> C) something else that I can't imagine?
>>
>>
>> B. IOW, nothing.
>
> ... which opens the door for a lot of interesting ways to use the
> persistence framework.  Linking your object to the root causes your
> object to be managed by a ZODB.Connection and you get all the  
> associated
> assumptions about pickling, ID management, etc.  But if you instead
> assign the object to some persistence manager other than a
> ZODB.Connection, you could integrate with other kinds of storage  
> systems
> without using pickles.  I don't think this area has been explored  
> nearly
> as much as it deserves.


Yup. In theory.  Currently, persistent's implementation is highly tied  
to ZODB, although I have plans for a much scaled down persistent in  
ZODB4. (Well, out of ZODB4, since it will no longer depend on ZODB. :)

Jim

--
Jim Fulton
Zope Corporation




More information about the ZODB-Dev mailing list