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

Shane Hathaway shane at hathawaymix.org
Fri Nov 14 18:51:47 EST 2008


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.

Shane



More information about the ZODB-Dev mailing list