tchandy/octopus — Issue #78: N'SELECT @@version' error ( activerecord-sqlserver-adapter + tiny_tds )
Author: goodmanship
Created: 2012-02-24 23:38:34+00:00
State: open

Hi-
Is anyone using octopus with SQL Server? I have not seen many posts about that combination. I am using multiple database shards in SQL Server and I can't get octopus to work with activerecord-sqlserver-adapter + tiny_tds.

I have tried with multiple versions of rails, and I get the same or similar errors. This particular error is from the git version of octopus, and rails 3.1.3.

Using activerecord (3.1.3)
Using activerecord-sqlserver-adapter (3.1.6)
Using ar-octopus (0.4.0) from git://github.com/tchandy/octopus.git (at master)
Using rails (3.1.3)
Using tiny_tds (0.5.1)

"rails c" starts up okay, but when I make a database call ("irb> Assignment.first") I get this error:

ActiveRecord::StatementInvalid: NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]: EXEC sp_executesql N'SELECT @@version'
from /Users/goodman/.bundler/ruby/1.9.1/octopus-f5fe24574cd6/lib/octopus/rails3/abstract_adapter.rb:27:in `octopus_shard'
...

I'm not even using a shard, I'm just using the database from the master db listed in database.yml, which works fine without octopus.
Any ideas? Any help would be much appreciated!
-Rio

( mssql tinytds sqlserver )