Skip to content

Commit be4074e

Browse files
committed
Renamed #with_auto_reconnect to #with_sqlserver_error_handling now that it handles both dropped
connections and deadlock victim errors.
1 parent 89741f6 commit be4074e

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11

22
* master *
33

4+
* Renamed #with_auto_reconnect to #with_sqlserver_error_handling now that it handles both dropped
5+
connections and deadlock victim errors. Fixes #150 [Joe Rafaniello]
6+
47
* Add activity_stats method that mimics the SQL Server Activity Monitor. Fixes #146 [Joe Rafaniello]
58

69
* Add methods for sqlserver's #product_version, #product_level, #edition and include them in inspect.

lib/active_record/connection_adapters/sqlserver/database_statements.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def valid_isolation_levels
392392
def do_execute(sql, name = nil)
393393
name ||= 'EXECUTE'
394394
log(sql, name) do
395-
with_auto_reconnect { raw_connection_do(sql) }
395+
with_sqlserver_error_handling { raw_connection_do(sql) }
396396
end
397397
end
398398

@@ -450,7 +450,7 @@ def _raw_select(sql, options={})
450450
end
451451

452452
def raw_connection_run(sql)
453-
with_auto_reconnect do
453+
with_sqlserver_error_handling do
454454
case @connection_options[:mode]
455455
when :dblib
456456
@connection.execute(sql)

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ def remove_database_connections_and_rollback(database=nil)
488488
end if block_given?
489489
end
490490

491-
def with_auto_reconnect
491+
def with_sqlserver_error_handling
492492
begin
493493
yield
494494
rescue Exception => e

0 commit comments

Comments
 (0)