[ZODB-Dev] Re: Stripping a Persistent Object of it's Persistence?

Tres Seaver tseaver at palladion.com
Mon Feb 18 14:19:41 EST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kenneth Miller wrote:
> This topic has come up in the past (), but I was curious what would be the
> best way to transfer an object from one file-storage to another, or for
> taking an object in and out of storage. What I'm trying to do is have a
> number of clients place objects into an "incoming" list inside of my DB, and
> then have another client that acts as a "Manager" to organize and validate
> all of these incoming objects. The manager rearranges these objects inside
> of the DB. So is moving an object from on storage to another the same as
> taking an object in and out of a particular storage? Do i need to do
> anything special for this?

Your best bet is to treat this as the equivalent of a ZODB export and
import, e.g., using the OFS.CopySupport machinery in Zope2:  that
machinery creates a pickled representation of the source object, then
unpickles it to create a clone.  The clone is not attached to any
storage, so when you "seat" it into its new location, it gets assigned
to that location's storage.


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHudpM+gerLs4ltQ4RApAWAJ97CL0otgU60IT1O5uPrcSyl4U7dgCfWqJt
ZdxonTujKT2+senAjM9Qh2I=
=UJCU
-----END PGP SIGNATURE-----



More information about the ZODB-Dev mailing list