Random DBI::DatabaseError while querying SqlServer


#1

First some background:

Application is running on a windows XP
I’m currently using Ruby version 1.8.6-26 with easy installer (I
couldn’t
manage to manually install 1.8.7)
Rails version is 2.2.2
activerecord version 2.2.2, 1.15.6
activerecord-sqlserver-adapter is version 1.0.0.9250
ADO.rb version is 0.1.0 (couldn’t find anything newer, is it abandoned
or
something?)
SqlServer 2000 (I tried with sql server 2005 same problem continues)

I don’t know it’s related but as session store I’m using
active_record_store

Problem:
Database queries are generally working fine, but sometimes (lets say
once in
30-40 queries) I get a strange error at sqlserver_adapter.rb, the error
message and stack trace is as follows.

DBI::DatabaseError: Value
OLE error code:8000FFFF in Microsoft OLE DB Provider for SQL Server
Iİşlem::Kaydet veya Iİşlem::Durdur çağrıldı ve nesne meşgul
durumda.
HRESULT error code:0x80020009
?zel durum olu?tu.: SELECT * FROM [product] WHERE
([product].[isActive] = 1 AND [product].[useInMobileOrder] = 1)

C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract_adapter.rb:188:in
log' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0.9250/lib/active_record/connection_adapters/sqlserver_adapter.rb:337:inexecute’
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0.9250/lib/active_record/connection_adapters/sqlserver_adapter.rb:538:in
select' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:7:inselect_all_without_query_cache’
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in
select_all' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:81:incache_sql’
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in
select_all' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:635:infind_by_sql’
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1490:in
find_every' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:589:infind’
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:in
send' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:inperform_action_without_filters’
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:617:in
call_filters' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:638:inrun_before_filters’
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:178:in
send' C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:178:inevaluate_method’
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:186:in
call' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:635:inrun_before_filters’
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:615:in
call_filters' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:610:inperform_action_without_benchmark’
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in
perform_action_without_rescue' C:/ruby/lib/ruby/1.8/benchmark.rb:293:inmeasure’
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in
perform_action_without_rescue' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/rescue.rb:136:inperform_action_without_caching’
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:13:in
perform_action' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:34:incache’
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/query_cache.rb:8:in
cache' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:12:inperform_action’
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in
send' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:inprocess_without_filters’
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:606:in
process_without_session_management_support' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/session_management.rb:134:inprocess’
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:392:in
process' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:183:inhandle_request’
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:110:in
dispatch_unlocked' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:123:indispatch’
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:in
synchronize' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:indispatch’
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:132:in
dispatch_cgi' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:39:indispatch’
C:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:103:in
handle_dispatch' C:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:74:inservice’
C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in service' C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:inrun’
C:/ruby/lib/ruby/1.8/webrick/server.rb:173:in start_thread' C:/ruby/lib/ruby/1.8/webrick/server.rb:162:instart’
C:/ruby/lib/ruby/1.8/webrick/server.rb:162:in start_thread' C:/ruby/lib/ruby/1.8/webrick/server.rb:95:instart’
C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in each' C:/ruby/lib/ruby/1.8/webrick/server.rb:92:instart’
C:/ruby/lib/ruby/1.8/webrick/server.rb:23:in start' C:/ruby/lib/ruby/1.8/webrick/server.rb:82:instart’
C:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:60:in
dispatch' C:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/servers/webrick.rb:66 C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:inrequire’
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in
new_constants_in' C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:inrequire’
C:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/server.rb:49
C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’

Translation of Error message
The error message seems to be coming from Microsoft provider so it’s
message
is localized to Turkish. A direct translation would be something like

DBI::DatabaseError: Value
OLE error code:8000FFFF in Microsoft OLE DB Provider for SQL Server
ITransaction::Commit or ITransaction::Abort was called, and
object is
in a zombie state.

Any ideas to solve the problem?

Thx in advance