On Friday, September 2, 2016 at 10:43:50 AM UTC-7, Trevor Turk wrote: > > Hello -- just reporting back on my progress so far. > > It appears we can use paged_each safely, however I was surprised to find > that we can't run two simultaneously if they issue updates in the block. >
In general it's not safe to issue queries inside a Dataset#each (and #paged_each) block, unless you force the use of a different connection. Whether it works depends on the adapter, but it's always unsupported. To work around this issue, you can use sharding (Dataset option like :servers=>{:foo=>{}}), and do dataset.server(:foo).paged_each. Alternatively, you can issue queries in a separate thread inside the Dataset#each block. Even something simple like dataset.each{Thread.new{...}.join} should work. Please try one of those options and report back. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to sequel-talk+unsubscr...@googlegroups.com. To post to this group, send email to sequel-talk@googlegroups.com. Visit this group at https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.