toolhound-ruby 1.0.36 → 1.0.37

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ee15d4ced0e762f23dc23b7c2eb37ef70c71f87
4
- data.tar.gz: 4597f27eaa2447c07bda3e7abb2e67cde831fe50
3
+ metadata.gz: e3354b35cb7cf30dfd460b5e126c985827c4a1ae
4
+ data.tar.gz: cb7a67f6ec21ede8c027bd659a71e6786e331229
5
5
  SHA512:
6
- metadata.gz: 215cd96b6743912943b7bdc44311edaec77a84900cc526bae9694a40e137536d3d88aac873abc38f478538cc4abd3b5a5f3f69908ee73cfb7e8af3eefde3ef85
7
- data.tar.gz: 0bf05856caf02e776d4d63ee7ae511172a4a6af86895bc3ad2a8fa9623e6dc42d728b9e4a4e95243471796973dfc375e6da3fce8fd225fc3a169521a02b9aaa1
6
+ metadata.gz: 9bb22ec51a2b65cdafa49bd17369d6147f1083a96a436b32500fb3973bfb4ed2de92ffcf68ddf78b196560d535510853d3f265ad6b2acc3e9897a10e41012a5d
7
+ data.tar.gz: b99f003aa73b416fc0b0654c83fe2ff084ef8e6e16c0a7e17e4e8b3d30ba1975ff15ada0ccda7bc9ea0df97b97f130b9bccf2093acafcab89039eb0edf535dbd
@@ -301,29 +301,41 @@ module Toolhound
301
301
 
302
302
  def query(query, options = {})
303
303
  data = []
304
+ tries ||= 3
304
305
  begin
305
306
  results = connection.execute(query)
306
307
  opts = {cache_rows: false}.merge(options || {})
307
-
308
308
  results.each(opts) do |row|
309
309
  data << transform_attributes(row)
310
310
  end
311
311
  data
312
- rescue TinyTds::Error
313
- client.reset_connection
314
- retry
312
+ rescue TinyTds::Error => e
313
+ if e.message =~ /^DBPROCESS/
314
+ client.reset_connection
315
+ retry unless (tries -= 1).zero?
316
+ else
317
+ # throw the error again
318
+ raise
319
+ end
320
+
315
321
  end
316
322
  ensure
317
323
  finish_statement_handle(results)
318
324
  end
319
325
 
320
326
  def update_query(query, options)
327
+ tries ||= 3
321
328
  begin
322
329
  result = connection.execute(query)
323
330
  result.do
324
- rescue TinyTds::Error
325
- client.reset_connection
326
- retry
331
+ rescue TinyTds::Error => e
332
+ if e.message =~ /^DBPROCESS/
333
+ client.reset_connection
334
+ retry unless (tries -= 1).zero?
335
+ else
336
+ # throw the error again
337
+ raise
338
+ end
327
339
  end
328
340
  ensure
329
341
  finish_statement_handle(result)
@@ -1,3 +1,3 @@
1
1
  module Toolhound
2
- VERSION = "1.0.36"
2
+ VERSION = "1.0.37"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toolhound-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.36
4
+ version: 1.0.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Klooth