These are chat archives for rails-sqlserver/activerecord-sqlserver-adapter

Sep 2017
Andrei Botalov
Sep 12 2017 15:30
I use TinyTds to make queries to MS SQL Server 2008 R2.
A ruby process sequentially makes queries, invokes .each to return responses, then makes another query...
Intermittently, a query fails with an error "TinyTds::Error: Read from the server failed".
After such fail happens subsequent queries made using this connection fail with "TinyTds::Error: DBPROCESS is dead or not enabled".
Could you please advise why "Read from the server failed" may appear and how to investigate this?
Ken Collins
Sep 12 2017 17:18
Hey there Andrei... if you are going to use TinyTDS raw, follow what things like the adapter do.
For example, calling cancel on the result all the time is needed. We describe this in our docs too.
Andrei Botalov
Sep 12 2017 19:20
Thanks for a response, Ken!
I think every time when I do connection.execute(sql), I also do .each on the result (without passing parameters to .each). I see that ActiveRecord adapter invokes .cancel as well.
Is invoking .cancel after .each needed?
Also these errors are intermittent.