The other approach would be to only store objects in one canonical place, and use references that just store the path to the object or the oid.
Chris On Thu, Apr 21, 2016 at 3:36 AM, Joe Steeve <[email protected]> wrote: > How to maintain "referential integrity" in a ZODB. Simply put: When an > object-A is removed from a container, the references to object-A, in > other objects should go invalid. > > I tried holding a persistent.WeakRef whenever a reference was required. > However, the WeakRef seems to go invalid only after a GC on the db > (correct me if I am wrong). > > The other approach seems to be to use IObjectWillBeRemovedEvent at the > site of the referencing object, to act accordingly. > > How do other people deal with this? > > -- > Joe Steeve > HiPro IT Solutions Private Limited > http://hipro.co.in/ > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/pylons-discuss/1461224218.20052.19.camel%40hipro.co.in > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAGZ7LV9-rkNSO2eAVu0uEJEHgJY6_A7PSW8isCqjV2K_THyCXQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
