rails-sqlserver/tiny_tds — Issue #56: tidy_tds does not accept more than one execute
Author: horaceho
Created: 2011-10-26 10:17:19+00:00
State: open

This happend today, I don't know how to reset tidy_tds to make it work as before.

The following is an example to illustrate the symtoms:

C:\>ruby test_use.rb
one
two
C:/test_use.rb:15:in `execute': Attempt to initiate a new Adaptive Server operation with results pending (TinyTds::Error)
from C:/test_use.rb:15

The code is simply as three `USE`s:

require 'rubygems'
require 'yaml'
require 'fastercsv'
require 'tiny_tds'
require 'iconv'

CONFIG = YAML.load_file("config.yml")

client = TinyTds::Client.new(:username => CONFIG["db"]["username"], :password => CONFIG["db"]["password"],
:host => CONFIG["db"]["server"], :database => CONFIG["db"]["database"])

puts "one"
client.execute("USE DATAFEED")
puts "two"
client.execute("USE DATAFEED")
puts "three"
client.execute("USE DATAFEED")

Any clue what is the problem? I tried rebooting the Windows machine already.