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 +4 -4
- data/lib/neo4j-core/version.rb +1 -1
- data/lib/neo4j-server/cypher_transaction.rb +6 -1
- data/lib/neo4j/transaction.rb +24 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4f8a3a2a56fcb350b9dec6bed3c00561af9a66b
|
4
|
+
data.tar.gz: a8e483897c5de8b8a2f59f3050ee64bf2802064e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d344cf40505f38c5ecc76a5b80951b22bc5ff3945518c7316f93d4be1e99079bc78735d50a1899ced572a20ddbe729cc54c7c80eba94020733f5bde2e7ac99d7
|
7
|
+
data.tar.gz: e90b752dadb1a5dcfc6cb4334acf0826cce0d46aa55675e1a91f0a4350b869411c79e9f0ee510a7e31826782012e7aab038bcbb0b080234edce020e770d1350c
|
data/lib/neo4j-core/version.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/neo4j/transaction.rb
CHANGED
@@ -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
|
-
|
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.
|
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-
|
11
|
+
date: 2015-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|