After playing around with it over night, we ran into issues like you said. 
I then played around with your method, and I like that it locks up the 
thread executing as that user. I'm still fairly new to threading mutex and 
wondering if you think that'll affect how background jobs handles things. I 
took your methods and dropped them into a Suckerpunch job.  In the console, 
it seems to work fine.

class ExportCsvJob
  include SuckerPunch::Job


  def perform
    DB.execute_as('ADND\\user') do
      ds = DB[:"secure__Employee Snapshot Fact___Employee Snapshot Fact"]
      CSV.open("test.csv", 'wb') do |csv|
        csv << ds.first.keys
        # i = 1
        ds.each do |row|
          csv << row.valuesx
          #  puts i if i % 10_000 == 0
          #  i += 1
        end
      end
    end
  end
end

-- 
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 https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to