These are chat archives for rails-sqlserver/activerecord-sqlserver-adapter

22nd
Mar 2016
Ryan Condron
@rebelweb
Mar 22 2016 16:19
I am getting the error Attempt to initiate a new Adaptive Server operation with results pending using capybara's find function, has anyone come across this?
Ken Collins
@metaskills
Mar 22 2016 23:04
@rebelweb Sounds like a threading issue with your setup. Have you made sure your capybara tests run using a shared connection? See: http://stackoverflow.com/questions/8774227/why-not-use-shared-activerecord-connections-for-rspec-selenium
I use this with minitest and it works like a champ.
My Rails 4/5 setup does it this way.
class ActiveRecord::Base
CONNECTION_LOCK = Mutex.new
def self.connection ; CONNECTION_LOCK.synchronize { @@shared_base_connection ||= retrieve_connection } ; end
end
Hope that helps.