The symptom is:
症状是:
TinyTds::Error: Adaptive Server connection timed out: EXEC some_stored_procedure
TinyTds ::错误:Adaptive Server连接超时:EXEC some_stored_procedure
It's execute_procedure
a slow stored procedure on a slow MSSQL Server via ActiveRecord over tinytds
. If I EXEC
the stored procedure in SQL Query Analyzer, it takes 29 to 30 to finish.
它通过ActiveRecord通过tinytds在慢速MSSQL服务器上执行一个缓慢的存储过程。如果我在SQL查询分析器中执行存储过程,则需要29到30才能完成。
So I added:
所以我补充说:
timeout = 60
in /etc/freetds.conf
and:
在/etc/freetds.conf中:
read_timeout: 60
write_timeout: 60
to database.yml
.
The same error still shows up. Is there any other configs I missed?
同样的错误仍然出现。我错过了还有其他配置吗?
p.s. I did measure when the timeout error shows up with a timer after hitting return key, it's about 30 seconds. I have a feeling 30 seconds may not be the default timeout of freetds
or activerecord
and wonders why the error shows up somewhat close the time for the sql to finish ...
附:我确实在点击返回键后测量超时错误何时显示计时器,大概是30秒。我有一种感觉30秒可能不是freetds或activerecord的默认超时,并想知道为什么错误显示有点接近sql完成的时间...
1 个解决方案
#1
0
It has been pretty long time but someone may need this. I solved this by passing timeout:
option for creating tiny_tds client depend on git doc, see the below:
这已经很久了,但有人可能需要这个。我通过传递timeout来解决这个问题:创建tiny_tds客户端的选项取决于git doc,请参阅下面的内容:
client = TinyTds::Client.new username: 'sa', password: 'secret', host: 'mydb.host.net', timeout: 30
#1
0
It has been pretty long time but someone may need this. I solved this by passing timeout:
option for creating tiny_tds client depend on git doc, see the below:
这已经很久了,但有人可能需要这个。我通过传递timeout来解决这个问题:创建tiny_tds客户端的选项取决于git doc,请参阅下面的内容:
client = TinyTds::Client.new username: 'sa', password: 'secret', host: 'mydb.host.net', timeout: 30