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

Jim Fulton <[email protected]>
Newsgroups gmane.comp.web.zope.zodb
Message-ID <CAPDm-FjoEczp+Dr9GFL7FOOYnbd2nzQh5PW7k1YcKHLtWdgVqQ@mail.gmail.com>
On Thu, Feb 2, 2017 at 4:25 AM, Jo Gilder <[email protected]>
wrote:

> This only works if I am doing a write transaction
>

No, Sanjay's approach *should* work regardless.

There is some reason to suspect a bug though:
https://github.com/zopefoundation/ZODB/issues/63


> and I'm just reading so I don't get an up to date version.
>

When the transaction is committed, the read is checked and if it was out of
data, the transaction is aborted and retried.



> If I change a value on the object and then run in it will I get an up to
> date version do you think?
>

You'll get a conflict error and retry.  readCurrent does the same thing
without forcing a write,

Jim


>
>
> On Thursday, 2 February 2017 07:35:09 UTC, Sanjay Rao wrote:
>>
>> I think this `readCurrent` api can be used to get rid of this problem
>>
>> #make sure latest object gets read
>> myObject._p_jar.readCurrent(myObject)
>>
>>
>>
>>
>>
>> On Wednesday, 1 February 2017 23:35:11 UTC+5:30, 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/ERP5T
>>> ype/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.
>



-- 
Jim Fulton
http://jimfulton.info

-- 
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.