Re: Zeo and two processes changing the zodb - not getting the up to date version of the object
Jo Gilder <[email protected]>
| Newsgroups | gmane.comp.web.zope.zodb |
|---|---|
| Message-ID | <[email protected]> |
Thanks, I haven't used monkey patches before. I have now wrapped my readonly code in an explicit transaction and using readCurrent seems to be doing the job. More testing needed though. On Thursday, 2 February 2017 09:50:34 UTC, Julien Muchembled wrote: > > Le 02/02/17 à 10:26, Jo Gilder a écrit : > > Hi, do you have an example of this in use? I can't see where it is used > in your code base. > > It's a monkey-patch. Once this module is loaded, we know that we have a > up-to-date view of the DB when we start a transaction. > > Here is a place where it's important for us to have such behaviour: > > https://lab.nexedi.com/nexedi/erp5/blob/f6d96c460323a5b7094feff2fbbf545deb9195db/product/CMFActivity/Activity/SQLBase.py#L497 > > To check this, we also have a unit test at > > https://lab.nexedi.com/nexedi/erp5/blob/f6d96c460323a5b7094feff2fbbf545deb9195db/product/ERP5/tests/testInvalidationBug.py#L93 > > Julien > > > On Wednesday, 1 February 2017 18:05:11 UTC, Julien Muchembled wrote: > > > > Le 02/01/17 à 18:37, Jo Gilder a écrit : > > > I'm running zeo 4. Is there any way to do this without upgrading? > We are a week away from a release and upgrading zeo means upgrading lots of > other packages too. > > > > > You can use our monkey-patch on > > Connection.ping > > and > > Connection.newTransaction > > > > > https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5Type/patches/ZODBConnection.py > < > https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5Type/patches/ZODBConnection.py> > > > > > Julien > > > -- You received this message because you are subscribed to the Google Groups "zodb" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.