On Monday, July 7, 2014 12:03:02 AM UTC-3, Jeremy Evans wrote:
>
> There are 3 separate errors here, but they are consistent with my guess 
> that you were running queries while iterating over the results of another 
> query.  So you should focus getting things working using the separate 
> thread, in particular why you are getting that ActiveRecord error.
>

Solved the issue, which was unrelated to sequel.

    def import(*args)
      paged_each do |record|
        # Run any queries on a separate connection. ActiveRecord connections
        # need to be closed in order to not exhaust the pool.
        Thread.new do
          begin
            record.import(*args)
          rescue => e
            $stderr.puts "#{name}(#{record.pk.inspect}): #{e}"
          ensure
            ActiveRecord::Base.connection.close
          end
        end.join
      end
    end

Thanks so much for your help, Jeremy.

Regards 

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to