Skip to content

Commit

Permalink
Recognize another disconnect error in the tinytds adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyevans committed Jan 29, 2020
1 parent cc5c161 commit 8e28517
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
=== master

* Fix verbose warning in postgres adapter when using prepared statements recent versions of ruby-pg (jeremyevans)
* Recognize another disconnect error in the tinytds adapter (jeremyevans)

* Fix verbose warning in postgres adapter when using prepared statements and recent versions of ruby-pg (jeremyevans)

* Work correctly on Ruby 2.8+ by supporting second argument for initialize_clone (jeremyevans)

Expand Down
2 changes: 1 addition & 1 deletion lib/sequel/adapters/tinytds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def dataset_class_default

# Return true if the :conn argument is present and not active.
def disconnect_error?(e, opts)
super || (opts[:conn] && !opts[:conn].active?) || ((e.is_a?(::TinyTds::Error) && /\A(Attempt to initiate a new Adaptive Server operation with results pending|The request failed to run because the batch is aborted, this can be caused by abort signal sent from client|Adaptive Server connection timed out)/.match(e.message)))
super || (opts[:conn] && !opts[:conn].active?) || ((e.is_a?(::TinyTds::Error) && /\A(Attempt to initiate a new Adaptive Server operation with results pending|The request failed to run because the batch is aborted, this can be caused by abort signal sent from client|Adaptive Server connection timed out|DBPROCESS is dead or not enabled)/.match(e.message)))
end

# Dispose of any possible results of execution.
Expand Down

0 comments on commit 8e28517

Please sign in to comment.