neo4j-core 5.1.7 → 5.1.10

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: 270806b67718b4b05e99c73d1b1d2118fefe6dce
4
- data.tar.gz: 878b8d073dd7a1fbce2139524a92f195286325f4
3
+ metadata.gz: f4f8a3a2a56fcb350b9dec6bed3c00561af9a66b
4
+ data.tar.gz: a8e483897c5de8b8a2f59f3050ee64bf2802064e
5
5
  SHA512:
6
- metadata.gz: d4f9e836e2a5352c48621ef7bc0bfe40f6ec6cab15fcc7b32a003e719a11211d78e35c247ea2e51fc1c50926babe3215285a054541e511483ab9d72bfdae2707
7
- data.tar.gz: fea94937e02b32ffdd8bf6a5bbf8bee6f9e7ac6b56b1cab031ec9c5c918a03bcca21df1b2e87e5edb4b5f7c837fbca30e99b088d6981dd82352f9fc2717411fd
6
+ metadata.gz: d344cf40505f38c5ecc76a5b80951b22bc5ff3945518c7316f93d4be1e99079bc78735d50a1899ced572a20ddbe729cc54c7c80eba94020733f5bde2e7ac99d7
7
+ data.tar.gz: e90b752dadb1a5dcfc6cb4334acf0826cce0d46aa55675e1a91f0a4350b869411c79e9f0ee510a7e31826782012e7aab038bcbb0b080234edce020e770d1350c
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Core
3
- VERSION = '5.1.7'
3
+ VERSION = '5.1.10'
4
4
  end
5
5
  end
@@ -73,12 +73,17 @@ module Neo4j
73
73
  cypher_response.set_data(first_result)
74
74
  else
75
75
  first_error = response.body[:errors].first
76
- mark_expired if first_error[:message].match(/Unrecognized transaction id/)
76
+ tx_cleanup!(first_error)
77
77
  cypher_response.set_error(first_error)
78
78
  end
79
79
  end
80
80
  end
81
81
 
82
+ def tx_cleanup!(first_error)
83
+ autoclosed!
84
+ mark_expired if first_error[:message].match(/Unrecognized transaction id/)
85
+ end
86
+
82
87
  def empty_response
83
88
  OpenStruct.new(status: 200, body: '')
84
89
  end
@@ -21,6 +21,18 @@ module Neo4j
21
21
  end
22
22
  alias_method :failure?, :failed?
23
23
 
24
+ def autoclosed!
25
+ @autoclosed = true if transient_failures_autoclose?
26
+ end
27
+
28
+ def transient_failures_autoclose?
29
+ Neo4j::Session.current.version >= '2.2.6'
30
+ end
31
+
32
+ def autoclosed?
33
+ !!@autoclosed
34
+ end
35
+
24
36
  def mark_expired
25
37
  @expired = true
26
38
  end
@@ -61,7 +73,18 @@ module Neo4j
61
73
  return if @pushed_nested >= 0
62
74
  fail "Can't commit transaction, already committed" if @pushed_nested < -1
63
75
  Neo4j::Transaction.unregister(self)
64
- failed? ? delete : commit
76
+ post_close!
77
+ end
78
+
79
+ private
80
+
81
+ def post_close!
82
+ return if autoclosed?
83
+ if failed?
84
+ delete
85
+ else
86
+ commit
87
+ end
65
88
  end
66
89
  end
67
90
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.7
4
+ version: 5.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Ronge, Chris Grigg, Brian Underwood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-14 00:00:00.000000000 Z
11
+ date: 2015-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty