Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Make login timeout and query timeout backward database.yml friendly f…

…or :dblib mode.
  • Loading branch information...
commit a5975322683fa8e719e96e1177b4b8bf8ff064dd 1 parent 468ef64
Ken Collins metaskills authored
5 CHANGELOG
... ... @@ -1,4 +1,9 @@
1 1
  2 +* master *
  3 +
  4 +* Make login timeout and query timeout backward database.yml friendly for :dblib mode.
  5 +
  6 +
2 7 * 3.0.4 *
3 8
4 9 * Add multiple results set support with #execute_procedure for :dblib mode. [Ken Collins]
6 lib/active_record/connection_adapters/sqlserver_adapter.rb
@@ -346,6 +346,8 @@ def connect
346 346 @connection = case @connection_options[:mode]
347 347 when :dblib
348 348 appname = config[:appname] || Rails.application.class.name.split('::').first rescue nil
  349 + login_timeout = config[:login_timeout].present? ? config[:login_timeout].to_i : nil
  350 + timeout = config[:timeout].present? ? config[:timeout].to_i : nil
349 351 encoding = config[:encoding].present? ? config[:encoding] : nil
350 352 TinyTds::Client.new({
351 353 :dataserver => config[:dataserver],
@@ -353,8 +355,8 @@ def connect
353 355 :password => config[:password],
354 356 :database => config[:database],
355 357 :appname => appname,
356   - :login_timeout => config[:dblib_login_timeout],
357   - :timeout => config[:dblib_timeout],
  358 + :login_timeout => login_timeout,
  359 + :timeout => timeout,
358 360 :encoding => encoding
359 361 }).tap do |client|
360 362 client.execute("SET ANSI_DEFAULTS ON").do

0 comments on commit a597532

Please sign in to comment.
Something went wrong with that request. Please try again.