DatabaseCleaner / database_cleaner-active_record

Strategies for cleaning databases using ActiveRecord. Can be used to ensure a clean state for testing.
MIT License
64 stars 63 forks source link

Invalid cursor state when used in conjunction with FreeTDS #30

Closed bigtunacan closed 1 year ago

bigtunacan commented 12 years ago

I'm getting an ODBC::Error Invalid cursor state during the database_cleaner "clean" step.

Stack trace provided below.

ODBC::Error: 24000 (0) [FreeTDS][SQL Server]Invalid cursor state: SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' ORDER BY TABLE_NAME (ActiveRecord::StatementInvalid) /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activerecord-sqlserver-adapter-3.2.9/lib/active_record/connection_adapters/sqlserver/database_statements.rb:389:in run' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activerecord-sqlserver-adapter-3.2.9/lib/active_record/connection_adapters/sqlserver/database_statements.rb:389:inblock in raw_connection_run' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activerecord-sqlserver-adapter-3.2.9/lib/active_record/connection_adapters/sqlserver_adapter.rb:502:in with_sqlserver_error_handling' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activerecord-sqlserver-adapter-3.2.9/lib/active_record/connection_adapters/sqlserver/database_statements.rb:384:inraw_connection_run' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activerecord-sqlserver-adapter-3.2.9/lib/active_record/connection_adapters/sqlserver/database_statements.rb:376:in _raw_select' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activerecord-sqlserver-adapter-3.2.9/lib/active_record/connection_adapters/sqlserver/database_statements.rb:371:inblock in raw_select' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract_adapter.rb:280:in block in log' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.2/lib/active_support/notifications/instrumenter.rb:20:ininstrument' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract_adapter.rb:275:in log' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activerecord-sqlserver-adapter-3.2.9/lib/active_record/connection_adapters/sqlserver/database_statements.rb:371:inraw_select' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activerecord-sqlserver-adapter-3.2.9/lib/active_record/connection_adapters/sqlserver/database_statements.rb:9:in select_rows' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:38:inselect_values' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activerecord-sqlserver-adapter-3.2.9/lib/active_record/connection_adapters/sqlserver/schema_statements.rb:11:in tables' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/database_cleaner-0.9.1/lib/database_cleaner/active_record/truncation.rb:25:indatabase_cleaner_table_cache' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/database_cleaner-0.9.1/lib/database_cleaner/active_record/truncation.rb:243:in tables_to_truncate' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/database_cleaner-0.9.1/lib/database_cleaner/active_record/truncation.rb:235:inblock in clean' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activerecord-sqlserver-adapter-3.2.9/lib/active_record/connection_adapters/sqlserver_adapter.rb:267:in disable_referential_integrity' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/database_cleaner-0.9.1/lib/database_cleaner/active_record/truncation.rb:231:inclean' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/database_cleaner-0.9.1/lib/database_cleaner/base.rb:77:in clean' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/database_cleaner-0.9.1/lib/database_cleaner/configuration.rb:79:inblock in clean' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/database_cleaner-0.9.1/lib/database_cleaner/configuration.rb:79:in each' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/database_cleaner-0.9.1/lib/database_cleaner/configuration.rb:79:inclean' /usr/local/rvm/gems/ruby-1.9.2-p320/gems/cucumber-rails-1.3.0/lib/cucumber/rails/hooks/database_cleaner.rb:9:in `After'

etagwerker commented 1 year ago

Closing this issue due to inactivity.