From a968cf7b2c6fb767b3d5ff7e8d8de2b0887d5218 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Tue, 31 Oct 2023 12:29:11 -0700 Subject: [PATCH] Also disable the use of SQL states in the jdbc/sqlserver adapter Similar to jdbc/sqlanywhere, apparently jdbc/sqlserver does not correct use SQL states. --- lib/sequel/adapters/jdbc/sqlserver.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/sequel/adapters/jdbc/sqlserver.rb b/lib/sequel/adapters/jdbc/sqlserver.rb index 1bdb25ba4d..5b55a3e635 100644 --- a/lib/sequel/adapters/jdbc/sqlserver.rb +++ b/lib/sequel/adapters/jdbc/sqlserver.rb @@ -79,6 +79,10 @@ def _metadata_dataset super.with_extend(MetadataDatasetMethods) end + def database_exception_use_sqlstates? + false + end + def disconnect_error?(exception, opts) super || (exception.message =~ /connection is closed/) end