Re: Zeo and two processes changing the zodb - not getting the up to date version of the object

Julien Muchembled <[email protected]>
Newsgroups gmane.comp.web.zope.zodb
Message-ID <[email protected]>
Le 02/02/17 à 11:53, Jo Gilder a écrit :
> 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.

Maybe I didn't understand your issue but readCurrent has a different purpose than all other suggested solutions (which actually all do the same thing):
- ZEO 5 with server-sync true
- ping the server explictely before transaction.begin() (which may be annoying to maintain in your code)
- use our monkey-patch

Julien

> 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 <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 <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> <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] <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.