Sniff, was Re: [ZODB-Dev] Copying instances between multiple storages
Christian Reis
kiko@async.com.br
Tue, 21 May 2002 18:21:31 -0300
On Tue, May 21, 2002 at 01:11:14PM +0100, Toby Dickenson wrote:
>
> >something has been mentioned called Mount*Storage; I'd suppose it'd do
> >something like that, but I haven't seen it yet.
>
> No, it works very differently. It integrates two different object
> database at the zope application layer, not at object layer.
Okay, and since I don't use zope, there's not much use to me :-)
> >copy.Error: un(shallow)copyable object of type <extension class
> >Domain.Product.Product at 83ccba8>
>
> Aha, yes. it doesnt know how to automatically copy extension classes.
>
> You might want to try hacking the copy module so that it uses the
> _copy_int function for extension class instances as well as ordinary
> functions. I dont see why that shouldnt work (but Ive been known to
> be wrong in making statements like that ;-)
>
> >And deepcopy provides me the same error, so I probably have to define
> >__*copy__ if it is to work, right?
If I defined __*copy__, could I get around the natural limitation of
copy (you'll notice I have no idea how it works :-)
> >Yes, addressing is another problem, but it doesn't invalidate the
> >problems with cloning objects, since I have to support disconnected
> >operation (that's the gist of it, actually - I need to copy objects
> >between databases).
>
> have you considered a solution at a lower layer; rsync Data.fs ?
Well, I have, actually. The thing is, my problem isn't that simple.
I have a set of stores that collect sales information. They also share a
common product database. The stores need to update a central server
nightly.
The product database could be rsynced, I think, and even the sales
information if each store had a separate .fs file.
Central server's DB
Store A Store B Store C
| | |
+------------+-----------+
|
Products
The problem is the object references - when I synced the store
databases, can I guarantee they can still find the original object
references to the external database products?
IOW, can we have stored references in ZODB that are cross-database-files?
Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL