I am currently running ruby ββon rails (ruby 1.8.7, rails 2.3.8) on a Windows 2008 server in IIS7. I use mongrel rails to run instances, and then add instances to the server farm in IIS7 to use.
When the application is started and somehow the connection to the database server is dropped, it seems that the rails application is still trying to connect using the ODBC connection, and I get the following error:
ActiveRecord::StatementInvalid (ODBC::Error: S0002 (208) [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'sessions_table'.: SELECT TOP 1 * FROM [sessions_table] WHERE ([sessions_table].[session_id] = 'e6a7e7bc3b72edf2662c2b97793694d2') ): vendor/gems/activerecord-sqlserver-adapter-2.3.10/lib/active_record/connection_adapters/sqlserver_adapter.rb:946:in `raw_select' vendor/gems/activerecord-sqlserver-adapter-2.3.10/lib/active_record/connection_adapters/sqlserver_adapter.rb:923:in `select' app/controllers/application_controller.rb:107:in `set_locale' haml (3.0.17) [v] lib/sass/plugin/rack.rb:41:in `call' haml (3.0.17) [v] lib/sass/plugin/rack.rb:41:in `call' config/initializers/mongrel.rb:62:in `dispatch_cgi'
This error disappears when I restart the mongrel services, however I would really like the application to recognize the odbc error and reset the connection automatically. Any ideas?
source share