activerecord-sqlserver-adapter 2.3.15 → 2.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ * 2.3.16 *
3
+
4
+ * TinyTDS enhancements for lost connections. Default connection mode.
5
+
6
+
2
7
  * 2.3.15 *
3
8
 
4
9
  * Version bump due to bad 2.3.14 release.
data/Rakefile CHANGED
@@ -17,7 +17,7 @@ def test_files
17
17
  end
18
18
 
19
19
 
20
- task :test => ['test:odbc']
20
+ task :test => ['test:dblib']
21
21
 
22
22
 
23
23
  namespace :test do
@@ -9,12 +9,13 @@ module ActiveRecord
9
9
 
10
10
  def self.sqlserver_connection(config) #:nodoc:
11
11
  config = config.dup.symbolize_keys!
12
- config.reverse_merge! :mode => :odbc, :host => 'localhost', :username => 'sa', :password => ''
12
+ config.reverse_merge! :mode => :dblib, :host => 'localhost', :username => 'sa', :password => ''
13
13
  mode = config[:mode].to_s.downcase.underscore.to_sym
14
14
  case mode
15
15
  when :dblib
16
16
  raise ArgumentError, 'Missing :dataserver configuration.' unless config.has_key?(:dataserver)
17
17
  require_library_or_gem 'tiny_tds'
18
+ warn("TinyTds v0.4.3 or higher required. Using #{TinyTds::VERSION}") unless TinyTds::Client.instance_methods.include?("active?")
18
19
  when :odbc
19
20
  require_library_or_gem 'odbc' unless defined?(ODBC)
20
21
  require 'active_record/connection_adapters/sqlserver_adapter/core_ext/odbc'
@@ -147,7 +148,7 @@ module ActiveRecord
147
148
  class SQLServerAdapter < AbstractAdapter
148
149
 
149
150
  ADAPTER_NAME = 'SQLServer'.freeze
150
- VERSION = '2.3.15'.freeze
151
+ VERSION = '2.3.16'.freeze
151
152
  DATABASE_VERSION_REGEXP = /Microsoft SQL Server\s+(\d{4})/
152
153
  SUPPORTED_VERSIONS = [2000,2005,2008].freeze
153
154
  LIMITABLE_TYPES = ['string','integer','float','char','nchar','varchar','nvarchar'].to_set.freeze
@@ -158,7 +159,7 @@ module ActiveRecord
158
159
  :adonet => ['TypeError','System::Data::SqlClient::SqlException']
159
160
  }
160
161
  LOST_CONNECTION_MESSAGES = {
161
- :dblib => [/closed connection/, /dead or not enabled/],
162
+ :dblib => [/closed connection/, /dead or not enabled/, /server failed/i],
162
163
  :odbc => [/link failure/, /server failed/, /connection was already closed/, /invalid handle/i],
163
164
  :adonet => [/current state is closed/, /network-related/]
164
165
  }
@@ -319,15 +320,10 @@ module ActiveRecord
319
320
  # CONNECTION MANAGEMENT ====================================#
320
321
 
321
322
  def active?
322
- connected = case @connection_options[:mode]
323
- when :dblib
324
- !@connection.closed?
325
- when :odbc
326
- true
327
- else :adonet
328
- true
329
- end
330
- return false if !connected
323
+ case @connection_options[:mode]
324
+ when :dblib
325
+ @connection.active?
326
+ end
331
327
  raw_connection_do("SELECT 1")
332
328
  true
333
329
  rescue *lost_connection_exceptions
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-sqlserver-adapter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 35
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 3
9
- - 15
10
- version: 2.3.15
9
+ - 16
10
+ version: 2.3.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ken Collins
@@ -19,7 +19,7 @@ autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2011-03-01 00:00:00 -05:00
22
+ date: 2011-04-01 00:00:00 -04:00
23
23
  default_executable:
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  requirements: []
116
116
 
117
117
  rubyforge_project:
118
- rubygems_version: 1.5.0
118
+ rubygems_version: 1.6.2
119
119
  signing_key:
120
120
  specification_version: 3
121
121
  summary: SQL Server 2000, 2005 and 2008 Adapter For Rails.