Closed seydel1847 closed 1 year ago
When I do the same using tiny_tds and TinyTds::Client.new then it works like a hell. I started to trace some sequel methods with puts "#{self.object_id} / #{self.class} / #{method}" and error appears somewhere after '860 / Module / synchronize'.
It was my fault. I have used wrong port on MS-SQL when taking sequel snippet from the web.
Complete Description of Issue
I am running two instances of script connecting to MS-SQL database. The first is connected. The second is either rejected with error: `connect': TinyTds::Error: Adaptive Server connection failed (127.0.0.1) or it may hang up completely and I need to kill terminal.
Simplest Possible Self-Contained Example Showing the Bug
require "sequel" require 'tiny_tds'
db_connection_params = { :adapter => 'tinytds', :host => '127.0.0.1', :port => '1434', :database => 'xxx', :user => 'xxx', :password => 'xxx', :timeout => 600 }
@db = Sequel.connect(db_connection_params)
while true print '.' puts @db.test_connection sleep(1)
end
Full Backtrace of Exception (if any)
c:/R/Ruby30-x64/lib/ruby/gems/3.0.0/gems/tiny_tds-2.1.5/lib/tiny_tds/client.rb:60:in'
connect': TinyTds::Error: Adaptive Server connection failed (127.0.0.1) (Sequel::DatabaseConnectionError) from c:/R/Ruby30-x64/lib/ruby/gems/3.0.0/gems/tiny_tds-2.1.5/lib/tiny_tds/client.rb:60:in
initialize' from k:/code_workspace/research/gems/sequel/sequel/adapters/tinytds.rb:25:innew' from k:/code_workspace/research/gems/sequel/sequel/adapters/tinytds.rb:25:in
connect' from k:/code_workspace/research/gems/sequel/sequel/database/connecting.rb:280:innew_connection' from k:/code_workspace/research/gems/sequel/sequel/connection_pool.rb:162:in
make_new' from k:/code_workspace/research/gems/sequel/sequel/connection_pool/single.rb:28:inhold' from k:/code_workspace/research/gems/sequel/sequel/database/connecting.rb:331:in
synchronize' from k:/code_workspace/research/gems/sequel/sequel/database/connecting.rb:340:intest_connection' from k:/code_workspace/research/gems/sequel/sequel/database/misc.rb:188:in
initialize' from k:/code_workspace/research/gems/sequel/sequel/database/connecting.rb:68:innew' from k:/code_workspace/research/gems/sequel/sequel/database/connecting.rb:68:in
connect' from k:/code_workspace/research/gems/sequel/sequel/core.rb:124:inconnect' from con_test.rb:40:in
SQL Log (if any)
No response
Ruby Version
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x64-mingw32]
Sequel Version
sequel (5.67.0, 5.42.0), tiny_tds (2.1.5, 2.1.4, 2.1.3)