Re: [ZODB-Dev] Any risk about foreign zodb references

2011-07-19 Thread Alexandre Garel
Le 18/07/2011 18:16, David Glick a écrit :
 On 7/18/11 9:08 AM, Alexandre Garel wrote:
 Hello,

 We are building up an application where we use multiple zodb instances.
 Indexation is done using solr.
 zodb are served through zc.zodbwsgi. ZODB connections are set only
 on-demand, upon traversal. Each zodb has its intid local utility. Each
 object also has a uuid.

 I have a zodb with global parameters objects on /params and distinct
 zodb as /foo /bar /baz and so on.
 Objects in a zodb may reference objects of the same zodb or of /params.

 I have two possible strategies :

 - either store uuid of referenced objects and retrieve objects from solr
 (which will give me a zodb name + intid of object)
 - either directly reference the objects of /params

 Of course second option seems better and more natural.

 I read
 http://svn.zope.org/ZODB/trunk/src/ZODB/tests/multidb.txt?rev=99605view=markup
 and using pdb on databases = request.environ['zodb.connection'] I can
 see the zodb.databases map
 which is ok. I also know that _p_oid is unique and _p_jar handled for
 each object so I feel confident on this side.

 So before I dive into this, is this kind of cross-database reference
 used on production applications. Is there any-risk or any trick to be
 aware ?
 Using cross-database references can be treacherous, because the garbage
 collection that occurs when packing a ZODB the typical way is not aware
 of the cross-db references. So if there's an object in one db that is
 only referenced from a different db, it will get garbage-collected
 during packing. You can probably use
 http://pypi.python.org/pypi/zc.zodbdgc instead of standard packing to
 avoid that problem.

Thanks for the advice.

I normally won't fall in this case as my params objects are contained in 
parents and must exists even when all other zodb would not.

Thanks for your feedback.

-- 
Alex Garel



___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] RelStorage zodbconvert, ConflictError on Zope2 startup

2011-07-19 Thread Shane Hathaway
On 07/18/2011 02:16 PM, Sean Upton wrote:
 On Fri, Jul 15, 2011 at 5:35 PM, Shane Hathawaysh...@hathawaymix.org  wro=
 te:
 I am thinking of changing the memcache code to use a random per-database =
 key
 prefix. =A0If I had done that already, you would not have run into this
 problem, since clearing the database would cause RelStorage to use a new =
 key
 prefix. =A0Your old memcache data would have been ignored.

 +1, and it sounds like by consequence of design, this would be
 necessarily backward compatible with existing installations of 1.5.0?

Yes, it should be fully compatible with existing installations.

Shane
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev