MySQL connector issue

Joseph L. Casale jcasale at activenetwerx.com
Sun Oct 23 12:46:02 EDT 2016


> Perhaps you simplified too much, but changes between the select and the update could be lost. I think you need at least three states:
>
> 1 mark rows where baz is null (by setting baz to some value other than NULL or 42, 24, say: set baz = 24 where baz is NULL)
> 2 show marked rows (select ... where baz = 24)
> 3 mark rows as seen (set baz = 42 where baz = 24)

Hi Peter,
The UPDATE happens only if rows were found, the sleep is much longer as it
is expected that another application adds rows satisfying the SELECT.

It really is that simple which is why I am baffled. Given the throughput is so
low, if I close the cursor and connection at the end of loop and instantiate them
both at the start of the loop, it works as expected but that's obviously not optimal.

Thanks,
jlc



More information about the Python-list mailing list