[ZODB-Dev] Missing loader for multidatabase refs?

Sidnei da Silva sidnei at enfoldsystems.com
Fri Mar 30 10:10:27 EDT 2007


On 3/30/07, Jim Fulton <jim at zope.com> wrote:
> > Say there's two databases, and the
> > object in database '1' is the only one referencing some object in
> > database '2'. Since those references would be treated like weak
> > references, wouldn't the object in database '2' go away in a 'pack',
> > thus causing a PosKeyError when loading the object from database '1'
> > that still points to it?
>
> Yes. That is a limitation of cross-database references.

What can be done to avoid that? Not packing the databases at all?

Would it be possible to make the loading of a cross-database reference
that is gone return some sort of 'BrokenObject' instead of a
PosKeyError, to work around the problem temporarily?

> Note that treating the references differently in a pack can't help
> this as the references are in the referencing database, not the
> referenced database.
>
> It would be cool to have:
>
> - A multi-database pack that took multiple databases into account.
>    Such a feature is doable, but obviously, non-trivial.

Specially if the databases happen to be on different ZEO servers *wink*.

> - A non-GC pack that got rid of old records but didn't bother with GC.
>    This would be advantagious for lots of folks independent of cross-
> database reference issues.

Sounds like this would be the easiest way to solve the above issue?

> > Right. I'm wondering how I did end up with a cross-database reference.
> > Seems like a copy/paste through the ZMI caused it. My question is if
> > that's expected/correct.
>
> Cross database references are pretty transparent and automatic.
>
> Maybe there should be an option to make them less so.

Yes, such an option would be great.

> >> What version of ZODB are you using?
> >
> > The one included with Zope 2.9.6.
>
> Hm, are you using ZEO?
>
> I'm wondering what sort of release would be needed to help you out.

Yes, I'm using ZEO. I don't need any sort of release particularly, a
patch would be fine. As long as there's a Zope 2.9.x release sometime
in the future for the people that can't live with patches, it should
be ok.

-- 
Sidnei da Silva
Enfold Systems                http://enfoldsystems.com
Fax +1 832 201 8856     Office +1 713 942 2377 Ext 214


More information about the ZODB-Dev mailing list