neo4j-ruby-driver 5.7.0.alpha.6 → 6.0.0.alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/neo4j/driver/exceptions/neo4j_exception.rb +6 -6
- data/ruby/neo4j/driver/bookmark.rb +2 -2
- data/ruby/neo4j/driver/internal/async/immutable_connection_context.rb +5 -5
- data/ruby/neo4j/driver/internal/async/internal_async_session.rb +13 -7
- data/ruby/neo4j/driver/internal/async/network_session.rb +7 -7
- data/ruby/neo4j/driver/internal/async/unmanaged_transaction.rb +3 -3
- data/ruby/neo4j/driver/internal/cluster/routing_table_handler_impl.rb +1 -1
- data/ruby/neo4j/driver/internal/default_bookmark_holder.rb +2 -2
- data/ruby/neo4j/driver/internal/handlers/commit_tx_response_handler.rb +1 -3
- data/ruby/neo4j/driver/internal/handlers/routing_response_handler.rb +7 -16
- data/ruby/neo4j/driver/internal/handlers/session_pull_response_completion_listener.rb +1 -1
- data/ruby/neo4j/driver/internal/internal_bookmark.rb +2 -29
- data/ruby/neo4j/driver/internal/internal_session.rb +1 -1
- data/ruby/neo4j/driver/internal/messaging/encode/route_message_encoder.rb +1 -1
- data/ruby/neo4j/driver/internal/messaging/request/begin_message.rb +2 -2
- data/ruby/neo4j/driver/internal/messaging/request/run_with_metadata_message.rb +2 -2
- data/ruby/neo4j/driver/internal/messaging/request/transaction_metadata_builder.rb +2 -2
- data/ruby/neo4j/driver/internal/messaging/v3/bolt_protocol_v3.rb +3 -3
- data/ruby/neo4j/driver/internal/packstream/pack_stream.rb +0 -2
- data/ruby/neo4j/driver/internal/read_only_bookmark_holder.rb +4 -4
- data/ruby/neo4j/driver/internal/retry/exponential_backoff_retry_logic.rb +3 -2
- data/ruby/neo4j/driver/internal/session_factory_impl.rb +1 -1
- data/ruby/neo4j/driver/internal/summary/internal_notification.rb +2 -2
- data/ruby/neo4j/driver/internal/util/metadata_extractor.rb +1 -7
- data/ruby/neo4j/driver/version.rb +1 -1
- metadata +12 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2cb3ba5c3c1dda74bf82e77866ac67ad834c3cc0fbe34c60c6f94d15040f56f2
|
|
4
|
+
data.tar.gz: 50a8a7f3c771de94889c3edfc28e2c0d3f26fc80c39bae330d81b5d34aedf4ae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f2011130ffcc499091ded7d02ff85484ec8f170a4d7adca828bf7d125eaa9d4b3b1ec0d1c93b53b0d1379ac8b378bb5c77ef7f869e0d1ffe4a2fca4442672a1b
|
|
7
|
+
data.tar.gz: bae2f8340186a2f0ad94da8e24c193dfdea98bee1a814ea78df481b35e9f4e4ea93c1827b662a46a9a742eaf94d82b8e09b9721754aad2a26dfb77196429ce5d
|
|
@@ -7,14 +7,14 @@ module Neo4j
|
|
|
7
7
|
attr_reader :code, :suppressed
|
|
8
8
|
|
|
9
9
|
def initialize(*args)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@
|
|
13
|
-
|
|
10
|
+
@code = args.shift if args.count > 1
|
|
11
|
+
message = args.shift
|
|
12
|
+
@suppressed = args.shift
|
|
13
|
+
super(message)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def add_suppressed(
|
|
17
|
-
(@suppressed ||= [])
|
|
16
|
+
def add_suppressed(exception)
|
|
17
|
+
(@suppressed ||= []) << exception
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -13,8 +13,8 @@ module Neo4j
|
|
|
13
13
|
# Reconstruct bookmark from \bookmarks string values.
|
|
14
14
|
# @param values values obtained from a previous bookmark.
|
|
15
15
|
# @return A bookmark.
|
|
16
|
-
def self.from(
|
|
17
|
-
Internal::InternalBookmark.
|
|
16
|
+
def self.from(value)
|
|
17
|
+
Internal::InternalBookmark.new(value)
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -2,16 +2,16 @@ module Neo4j::Driver
|
|
|
2
2
|
module Internal
|
|
3
3
|
module Async
|
|
4
4
|
class ImmutableConnectionContext
|
|
5
|
-
attr :database_name, :mode, :
|
|
5
|
+
attr :database_name, :mode, :rediscovery_bookmarks, :impersonated_user
|
|
6
6
|
|
|
7
|
-
def initialize(database_name,
|
|
7
|
+
def initialize(database_name, bookmarks, mode)
|
|
8
8
|
@database_name = database_name
|
|
9
|
-
@
|
|
9
|
+
@rediscovery_bookmarks = bookmarks
|
|
10
10
|
@mode = mode
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
SINGLE_DB_CONTEXT = new(DatabaseNameUtil::DEFAULT_DATABASE,
|
|
14
|
-
MULTI_DB_CONTEXT = new(DatabaseNameUtil::SYSTEM_DATABASE,
|
|
13
|
+
SINGLE_DB_CONTEXT = new(DatabaseNameUtil::DEFAULT_DATABASE, [], AccessMode::READ)
|
|
14
|
+
MULTI_DB_CONTEXT = new(DatabaseNameUtil::SYSTEM_DATABASE, [], AccessMode::READ)
|
|
15
15
|
|
|
16
16
|
# A simple context is used to test connectivity with a remote server/cluster. As long as there is a read only service, the connection shall be established
|
|
17
17
|
# successfully. Depending on whether multidb is supported or not, this method returns different context for routing table discovery.
|
|
@@ -6,7 +6,7 @@ module Neo4j::Driver
|
|
|
6
6
|
@session = session
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
delegate :
|
|
9
|
+
delegate :last_bookmarks, :close_async, to: :@session
|
|
10
10
|
|
|
11
11
|
def run_async(query, parameters = {}, config = {})
|
|
12
12
|
@session.run_async(org.neo4j.driver.Query.new(query, **parameters), **config)
|
|
@@ -32,8 +32,10 @@ module Neo4j::Driver
|
|
|
32
32
|
tx_future = @session.begin_transaction_async(mode, ** config)
|
|
33
33
|
|
|
34
34
|
tx_future.when_complete do |tx, completion_error|
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
error = Util::Futures.completion_exception_cause(completion_error)
|
|
36
|
+
|
|
37
|
+
if !error.nil?
|
|
38
|
+
result_future.complete_exceptionally(error)
|
|
37
39
|
else
|
|
38
40
|
execute_work(result_future, tx, &work)
|
|
39
41
|
end
|
|
@@ -46,8 +48,10 @@ module Neo4j::Driver
|
|
|
46
48
|
work_future = safe_execute_work(tx, &work)
|
|
47
49
|
|
|
48
50
|
work_future.when_complete do |result, completion_error|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
error = Util::Futures.completion_exception_cause(completion_error)
|
|
52
|
+
|
|
53
|
+
if !error.nil?
|
|
54
|
+
close_tx_after_failed_transaction_work(tx, result_future, error)
|
|
51
55
|
else
|
|
52
56
|
close_tx_after_succeeded_transaction_work(tx, result_future, result)
|
|
53
57
|
end
|
|
@@ -79,8 +83,10 @@ module Neo4j::Driver
|
|
|
79
83
|
|
|
80
84
|
def close_tx_after_succeeded_transaction_work(tx, result_future, result)
|
|
81
85
|
tx.close_async(true).when_complete do |_ignored, completion_error|
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
commit_error = Util::Futures.completion_exception_cause(completion_error)
|
|
87
|
+
|
|
88
|
+
if !commit_error.nil?
|
|
89
|
+
result_future.complete_exceptionally(commit_error)
|
|
84
90
|
else
|
|
85
91
|
result_future.complete(result)
|
|
86
92
|
end
|
|
@@ -11,7 +11,7 @@ module Neo4j::Driver
|
|
|
11
11
|
@log = Logging::PrefixedLogger.new("[#{hash}]", logger)
|
|
12
12
|
@bookmark_holder = bookmark_holder
|
|
13
13
|
# @database_name = database_name.database_name
|
|
14
|
-
@connection_context = NetworkSessionConnectionContext.new(database_name, @bookmark_holder.
|
|
14
|
+
@connection_context = NetworkSessionConnectionContext.new(database_name, @bookmark_holder.bookmarks, impersonated_user)
|
|
15
15
|
@fetch_size = fetch_size
|
|
16
16
|
@open = Concurrent::AtomicBoolean.new(true)
|
|
17
17
|
end
|
|
@@ -28,7 +28,7 @@ module Neo4j::Driver
|
|
|
28
28
|
acquire_connection(mode).then do |connection|
|
|
29
29
|
ImpersonationUtil.ensure_impersonation_support(connection, connection.impersonated_user)
|
|
30
30
|
tx = UnmanagedTransaction.new(connection, @bookmark_holder, @fetch_size)
|
|
31
|
-
tx.begin_async(@bookmark_holder.
|
|
31
|
+
tx.begin_async(@bookmark_holder.bookmarks, config)
|
|
32
32
|
end&.tap { |new_transaction| @transaction = new_transaction }
|
|
33
33
|
end
|
|
34
34
|
|
|
@@ -42,8 +42,8 @@ module Neo4j::Driver
|
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
-
def
|
|
46
|
-
@bookmark_holder.
|
|
45
|
+
def last_bookmarks
|
|
46
|
+
@bookmark_holder.bookmarks
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
def release_connection_async
|
|
@@ -131,11 +131,11 @@ module Neo4j::Driver
|
|
|
131
131
|
# It has to be the initial bookmark given at the creation of the session.
|
|
132
132
|
# As only that bookmark could carry extra system bookmarks
|
|
133
133
|
attr_accessor :database_name
|
|
134
|
-
attr :mode, :
|
|
134
|
+
attr :mode, :rediscovery_bookmarks, :impersonated_user
|
|
135
135
|
|
|
136
|
-
def initialize(database_name,
|
|
136
|
+
def initialize(database_name, bookmarks, impersonated_user)
|
|
137
137
|
@database_name = database_name
|
|
138
|
-
@
|
|
138
|
+
@rediscovery_bookmarks = bookmarks
|
|
139
139
|
@impersonated_user = impersonated_user
|
|
140
140
|
end
|
|
141
141
|
|
|
@@ -35,8 +35,8 @@ module Neo4j::Driver
|
|
|
35
35
|
@state = State::ACTIVE
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
def begin_async(
|
|
39
|
-
@protocol.begin_transaction(@connection,
|
|
38
|
+
def begin_async(initial_bookmarks, config)
|
|
39
|
+
@protocol.begin_transaction(@connection, initial_bookmarks, config)
|
|
40
40
|
self
|
|
41
41
|
rescue Neo4j::Driver::Exceptions::AuthorizationExpiredException
|
|
42
42
|
@connection.terminate_and_release(Neo4j::Driver::Exceptions::AuthorizationExpiredException::DESCRIPTION)
|
|
@@ -175,7 +175,7 @@ module Neo4j::Driver
|
|
|
175
175
|
if exception
|
|
176
176
|
Util::ResultHolder.failed(exception)
|
|
177
177
|
else
|
|
178
|
-
@protocol.commit_transaction(@connection).then
|
|
178
|
+
@protocol.commit_transaction(@connection).then { @bookmark_holder.bookmarks = Set[it] }
|
|
179
179
|
end
|
|
180
180
|
end
|
|
181
181
|
|
|
@@ -33,7 +33,7 @@ module Neo4j::Driver
|
|
|
33
33
|
@log.debug("Routing table for database '#{@database_name.description}' is stale. #{@routing_table}")
|
|
34
34
|
|
|
35
35
|
fresh_cluster_composition_fetched(
|
|
36
|
-
@rediscovery.lookup_cluster_composition(@routing_table, @connection_pool, context.
|
|
36
|
+
@rediscovery.lookup_cluster_composition(@routing_table, @connection_pool, context.rediscovery_bookmarks,
|
|
37
37
|
nil))
|
|
38
38
|
else
|
|
39
39
|
# existing routing table is fresh, use it
|
|
@@ -8,9 +8,7 @@ module Neo4j::Driver
|
|
|
8
8
|
@result_holder = result_holder
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def on_success(metadata)
|
|
12
|
-
@result_holder.succeed(metadata[:bookmark]&.then(&InternalBookmark.method(:parse)))
|
|
13
|
-
end
|
|
11
|
+
def on_success(metadata) = @result_holder.succeed(Util::MetadataExtractor.extract_bookmark(metadata))
|
|
14
12
|
|
|
15
13
|
def on_failure(error)
|
|
16
14
|
@result_holder.fail(error)
|
|
@@ -19,12 +19,13 @@ module Neo4j::Driver
|
|
|
19
19
|
|
|
20
20
|
private
|
|
21
21
|
|
|
22
|
-
def handled_error(
|
|
22
|
+
def handled_error(received_error)
|
|
23
|
+
# TODO: probably not necessary with concurrent-ruby as it might not wrap exceptions like java
|
|
24
|
+
error = Futures.completion_exception_cause(received_error)
|
|
25
|
+
|
|
23
26
|
case error
|
|
24
27
|
when Exceptions::ServiceUnavailableException
|
|
25
28
|
handled_service_unavailable_exception(error)
|
|
26
|
-
when Exceptions::ProtocolException
|
|
27
|
-
handled_protocol_exception(error)
|
|
28
29
|
when Exceptions::ClientException
|
|
29
30
|
handled_client_exception(error)
|
|
30
31
|
when Exceptions::TransientException
|
|
@@ -35,22 +36,12 @@ module Neo4j::Driver
|
|
|
35
36
|
end
|
|
36
37
|
|
|
37
38
|
def handled_service_unavailable_exception(e)
|
|
38
|
-
|
|
39
|
-
Exceptions::SessionExpiredException
|
|
39
|
+
@error_handler.on_connection_failure(@address)
|
|
40
|
+
Exceptions::SessionExpiredException("Server at #{@address} is no longer available", e)
|
|
40
41
|
end
|
|
41
42
|
|
|
42
43
|
def handled_transient_exception(e)
|
|
43
|
-
|
|
44
|
-
e
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def handled_protocol_exception(e)
|
|
48
|
-
record_connection_failure
|
|
49
|
-
e
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def record_connection_failure
|
|
53
|
-
@error_handler.on_connection_failure(@address)
|
|
44
|
+
e.code == "Neo.TransientError.General.DatabaseUnavailable" ? error_handler.on_connection_failure(@address) : e
|
|
54
45
|
end
|
|
55
46
|
|
|
56
47
|
def handled_client_exception(e)
|
|
@@ -9,7 +9,7 @@ module Neo4j::Driver
|
|
|
9
9
|
|
|
10
10
|
def after_success(metadata)
|
|
11
11
|
release_connection
|
|
12
|
-
@bookmark_holder.
|
|
12
|
+
@bookmark_holder.bookmarks = Array(Util::MetadataExtractor.extract_bookmark(metadata)).to_set
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def after_failure(error)
|
|
@@ -1,36 +1,9 @@
|
|
|
1
1
|
module Neo4j::Driver
|
|
2
2
|
module Internal
|
|
3
|
-
class InternalBookmark
|
|
3
|
+
class InternalBookmark < String
|
|
4
4
|
include Bookmark
|
|
5
|
-
attr :values
|
|
6
|
-
delegate :hash, :empty?, to: :values
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
@values = values.to_set
|
|
10
|
-
end
|
|
11
|
-
EMPTY = new.freeze
|
|
12
|
-
|
|
13
|
-
def ==(other)
|
|
14
|
-
equal?(other) || self.class == other.class && values == other.values
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
alias eql? ==
|
|
18
|
-
|
|
19
|
-
def to_s
|
|
20
|
-
"Bookmark{values=#{values}}"
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
class << self
|
|
24
|
-
def empty
|
|
25
|
-
EMPTY
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def from(*bookmarks)
|
|
29
|
-
new(*bookmarks.reduce(Set.new) { |set, bookmark| set + bookmark.values })
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
alias parse new
|
|
33
|
-
end
|
|
6
|
+
def to_s = "Bookmark{value=#{super}}"
|
|
34
7
|
end
|
|
35
8
|
end
|
|
36
9
|
end
|
|
@@ -4,7 +4,7 @@ module Neo4j::Driver
|
|
|
4
4
|
extend AutoCloseable
|
|
5
5
|
extend Synchronizable
|
|
6
6
|
# include Ext::RunOverride
|
|
7
|
-
delegate :open?, :
|
|
7
|
+
delegate :open?, :last_bookmarks, to: :@session
|
|
8
8
|
auto_closeable :begin_transaction
|
|
9
9
|
sync :close, :begin_transaction, :run, :transaction
|
|
10
10
|
|
|
@@ -8,7 +8,7 @@ module Neo4j::Driver
|
|
|
8
8
|
Util::Preconditions.check_argument(message, Request::RouteMessage)
|
|
9
9
|
packer.pack_struct_header(3, message.signature)
|
|
10
10
|
packer.pack(message.routing_context)
|
|
11
|
-
packer.pack(message.bookmark
|
|
11
|
+
packer.pack(message.bookmark || [])
|
|
12
12
|
packer.pack(option(message))
|
|
13
13
|
end
|
|
14
14
|
|
|
@@ -5,10 +5,10 @@ module Neo4j::Driver
|
|
|
5
5
|
class BeginMessage < MessageWithMetadata
|
|
6
6
|
SIGNATURE = 0x11
|
|
7
7
|
|
|
8
|
-
def initialize(
|
|
8
|
+
def initialize(bookmarks, config, database_name, mode, impersonated_user)
|
|
9
9
|
super(Request::TransactionMetadataBuilder.build_metadata(
|
|
10
10
|
timeout: config[:timeout], tx_metadata: config[:metadata], database_name: database_name, mode: mode,
|
|
11
|
-
|
|
11
|
+
bookmarks: bookmarks, impersonated_user: impersonated_user))
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def signature
|
|
@@ -7,10 +7,10 @@ module Neo4j::Driver
|
|
|
7
7
|
attr_reader :query, :parameters
|
|
8
8
|
|
|
9
9
|
class << self
|
|
10
|
-
def auto_commit_tx_run_message(query, config, database_name, mode,
|
|
10
|
+
def auto_commit_tx_run_message(query, config, database_name, mode, bookmarks, impersonated_user)
|
|
11
11
|
metadata = Request::TransactionMetadataBuilder.build_metadata(
|
|
12
12
|
timeout: config[:timeout], tx_metadata: config[:metadata], database_name: database_name, mode: mode,
|
|
13
|
-
|
|
13
|
+
bookmarks: bookmarks, impersonated_user: impersonated_user)
|
|
14
14
|
new(query.text, query.parameters, metadata)
|
|
15
15
|
end
|
|
16
16
|
|
|
@@ -6,9 +6,9 @@ module Neo4j::Driver
|
|
|
6
6
|
MODE_READ_VALUE = 'r'
|
|
7
7
|
|
|
8
8
|
class << self
|
|
9
|
-
def build_metadata(timeout:, tx_metadata:, mode:,
|
|
9
|
+
def build_metadata(timeout:, tx_metadata:, mode:, bookmarks:, impersonated_user:,
|
|
10
10
|
database_name: DatabaseNameUtil.default_database)
|
|
11
|
-
{ bookmarks:
|
|
11
|
+
{ bookmarks: bookmarks.presence,
|
|
12
12
|
tx_timeout: timeout&.then(&DurationNormalizer.method(:milliseconds)),
|
|
13
13
|
tx_metadata: tx_metadata.presence,
|
|
14
14
|
mode: (MODE_READ_VALUE if mode == AccessMode::READ),
|
|
@@ -30,9 +30,9 @@ module Neo4j::Driver
|
|
|
30
30
|
message_dispatcher.prepare_to_close_channel
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
def begin_transaction(connection,
|
|
33
|
+
def begin_transaction(connection, bookmarks, config)
|
|
34
34
|
verify_database_name_before_transaction(connection.database_name)
|
|
35
|
-
begin_message = Request::BeginMessage.new(
|
|
35
|
+
begin_message = Request::BeginMessage.new(bookmarks, config, connection.database_name, connection.mode, connection.impersonated_user)
|
|
36
36
|
connection.write_and_flush(begin_message, Handlers::BeginTxResponseHandler.new)
|
|
37
37
|
end
|
|
38
38
|
|
|
@@ -51,7 +51,7 @@ module Neo4j::Driver
|
|
|
51
51
|
def run_in_auto_commit_transaction(connection, query, bookmark_holder, config, fetch_size)
|
|
52
52
|
verify_database_name_before_transaction(connection.database_name)
|
|
53
53
|
|
|
54
|
-
run_message = Request::RunWithMetadataMessage.auto_commit_tx_run_message(query, config, connection.database_name, connection.mode, bookmark_holder.
|
|
54
|
+
run_message = Request::RunWithMetadataMessage.auto_commit_tx_run_message(query, config, connection.database_name, connection.mode, bookmark_holder.bookmarks, connection.impersonated_user)
|
|
55
55
|
|
|
56
56
|
build_result_cursor_factory(connection, query, bookmark_holder, nil, run_message, fetch_size)
|
|
57
57
|
end
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
module Neo4j::Driver
|
|
2
2
|
module Internal
|
|
3
3
|
class ReadOnlyBookmarkHolder
|
|
4
|
-
attr_reader :
|
|
4
|
+
attr_reader :bookmarks
|
|
5
5
|
|
|
6
|
-
def initialize(
|
|
7
|
-
@
|
|
6
|
+
def initialize(bookmarks = Set[])
|
|
7
|
+
@bookmarks = bookmarks
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
def
|
|
10
|
+
def bookmarks=(_value) end
|
|
11
11
|
end
|
|
12
12
|
end
|
|
13
13
|
end
|
|
@@ -92,9 +92,10 @@ module Neo4j::Driver
|
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
work_stage.on_resolution do |fulfilled, result, completion_error|
|
|
95
|
-
|
|
95
|
+
error = Futures.completion_exception_cause(completion_error)
|
|
96
|
+
if error
|
|
96
97
|
# work failed in async way, attempt to schedule a retry
|
|
97
|
-
retry_on_error(result_future, work, start_time, retry_delay,
|
|
98
|
+
retry_on_error(result_future, work, start_time, retry_delay, error, errors)
|
|
98
99
|
else
|
|
99
100
|
result_future.fulfill(result)
|
|
100
101
|
end
|
|
@@ -13,7 +13,7 @@ module Neo4j::Driver
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def new_instance(fetch_size: @default_fetch_size, default_access_mode: AccessMode::WRITE, **config)
|
|
16
|
-
bookmark_holder = DefaultBookmarkHolder.new(
|
|
16
|
+
bookmark_holder = DefaultBookmarkHolder.new(Array(config[:bookmarks]).to_set)
|
|
17
17
|
create_session(parse_database_name(config), default_access_mode, bookmark_holder, fetch_size, config[:impersonated_user])
|
|
18
18
|
end
|
|
19
19
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Neo4j::Driver::Internal::Summary
|
|
4
|
-
class InternalNotification < Struct.new(:code, :title, :description, :
|
|
4
|
+
class InternalNotification < Struct.new(:code, :title, :description, :severity_level, :position)
|
|
5
5
|
|
|
6
6
|
VALUE_TO_NOTIFICATION = lambda do |value|
|
|
7
|
-
severity = value[:severity]
|
|
7
|
+
severity = value[:severity]
|
|
8
8
|
|
|
9
9
|
position = value[:position]&.then do |pos_value|
|
|
10
10
|
InternalInputPosition.new(*pos_value.values_at(:offset, :line, :column).map(&:to_i))
|
|
@@ -35,13 +35,7 @@ module Neo4j::Driver
|
|
|
35
35
|
Summary::InternalDatabaseInfo::DEFAULT_DATABASE_INFO
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
def
|
|
39
|
-
bookmark_value = metadata[:bookmark]
|
|
40
|
-
|
|
41
|
-
return InternalBookmark.parse(bookmark_value) if bookmark_value&.is_a? String
|
|
42
|
-
|
|
43
|
-
InternalBookmark.empty
|
|
44
|
-
end
|
|
38
|
+
def extract_bookmark(metadata) = metadata[:bookmark]&.then(&InternalBookmark.method(:new))
|
|
45
39
|
|
|
46
40
|
def extract_neo4j_server_version(metadata)
|
|
47
41
|
server_value = extract_server(metadata)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: neo4j-ruby-driver
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 6.0.0.alpha.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Heinrich Klobuczek
|
|
@@ -89,16 +89,16 @@ dependencies:
|
|
|
89
89
|
name: connection_pool
|
|
90
90
|
requirement: !ruby/object:Gem::Requirement
|
|
91
91
|
requirements:
|
|
92
|
-
- - "
|
|
92
|
+
- - ">="
|
|
93
93
|
- !ruby/object:Gem::Version
|
|
94
|
-
version: '
|
|
94
|
+
version: '0'
|
|
95
95
|
type: :runtime
|
|
96
96
|
prerelease: false
|
|
97
97
|
version_requirements: !ruby/object:Gem::Requirement
|
|
98
98
|
requirements:
|
|
99
|
-
- - "
|
|
99
|
+
- - ">="
|
|
100
100
|
- !ruby/object:Gem::Version
|
|
101
|
-
version: '
|
|
101
|
+
version: '0'
|
|
102
102
|
- !ruby/object:Gem::Dependency
|
|
103
103
|
name: ffaker
|
|
104
104
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -203,24 +203,21 @@ dependencies:
|
|
|
203
203
|
requirements:
|
|
204
204
|
- - ">="
|
|
205
205
|
- !ruby/object:Gem::Version
|
|
206
|
-
version: '
|
|
206
|
+
version: '4.0'
|
|
207
207
|
- - "<"
|
|
208
208
|
- !ruby/object:Gem::Version
|
|
209
|
-
version: '
|
|
209
|
+
version: '7'
|
|
210
210
|
type: :development
|
|
211
211
|
prerelease: false
|
|
212
212
|
version_requirements: !ruby/object:Gem::Requirement
|
|
213
213
|
requirements:
|
|
214
214
|
- - ">="
|
|
215
215
|
- !ruby/object:Gem::Version
|
|
216
|
-
version: '
|
|
216
|
+
version: '4.0'
|
|
217
217
|
- - "<"
|
|
218
218
|
- !ruby/object:Gem::Version
|
|
219
|
-
version: '
|
|
220
|
-
description:
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
==== To Install:
|
|
219
|
+
version: '7'
|
|
220
|
+
description: ''
|
|
224
221
|
email:
|
|
225
222
|
- heinrich@mail.com
|
|
226
223
|
executables: []
|
|
@@ -536,7 +533,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
536
533
|
- !ruby/object:Gem::Version
|
|
537
534
|
version: '0'
|
|
538
535
|
requirements: []
|
|
539
|
-
rubygems_version:
|
|
536
|
+
rubygems_version: 3.6.9
|
|
540
537
|
specification_version: 4
|
|
541
|
-
summary:
|
|
538
|
+
summary: ''
|
|
542
539
|
test_files: []
|