[Zope-CVS] CVS: Products/AdaptableStorage/serial_std - public.py:1.7 RemainingState.py:NONE

Shane Hathaway shane@zope.com
Fri, 13 Dec 2002 15:42:33 -0500


Update of /cvs-repository/Products/AdaptableStorage/serial_std
In directory cvs.zope.org:/tmp/cvs-serv32288/serial_std

Modified Files:
	public.py 
Removed Files:
	RemainingState.py 
Log Message:
Hopefully solved the problem of unmanaged persistent objects.

Because AdaptableStorage lets the mappers choose their own persistence
boundaries, some objects that inherit from Persistent may be unknown
to ZODB, even though they are in the database.  I call these unmanaged
persistent objects.

The problem with unmanaged persistent objects surfaces when you change
them without changing their container.  For example, if you add an
item to a BTree, the BTree object (which is managed) does not get
changed, but rather a contained Bucket object (which is often
unmanaged).  We really need the BTree to be notified when the Buckets
change.

To solve this, certain aspect serializers (currently only
RemainderSerializer) now detect unmanaged persistent objects and addq
them to a list.  ZODB looks over this list and assigns them a one-off
"_p_jar" with a register() method.  This special register() method
just sets the _p_changed attribute of the managed object, notifying
ZODB that it must be saved.

I think this is the best solution, even though it's awfully complex to
explain.  The change involved moving the RemainingState aspect to the
"zodb" subpackage, since it already depended on the particulars of the
Persistent base class anyway.  It also required changing
ObjectSerializer so that the event object gets constructed by the
caller, which is appropriate, I think.

Also made some minor changes.


=== Products/AdaptableStorage/serial_std/public.py 1.6 => 1.7 ===
--- Products/AdaptableStorage/serial_std/public.py:1.6	Mon Dec  9 15:27:09 2002
+++ Products/AdaptableStorage/serial_std/public.py	Fri Dec 13 15:42:03 2002
@@ -23,6 +23,5 @@
 from IgnoredAttribute import IgnoredAttribute
 from MappingGateway import MappingGateway
 from PathKeychainGenerator import PathKeychainGenerator
-from RemainingState import RemainingState
 from RollCall import RollCall
 from StringDataAttribute import StringDataAttribute

=== Removed File Products/AdaptableStorage/serial_std/RemainingState.py ===