-
Notifications
You must be signed in to change notification settings - Fork 30
WIP: Session execute_read/write implementation #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 5.0
Are you sure you want to change the base?
Conversation
6a47c16
to
db04fb7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our spec write transaction function retries deadlocks
corresponds to java test writeTransactionFunctionShouldRetryDeadlocks
. That test is marked as deprecated. I don't see any tests testing the same functionality with executeWrite
in java so we should not either. Let's exclude this test.
Furthermore, I think it would make sense to disable the deprecation message in test environment for readability.
check do | ||
super( | ||
->(tx) { Struct::Wrapper.new(reverse_check { block.call(tx) }) }, | ||
to_java_config(Neo4j::Driver::TransactionConfig, **config) | ||
).object | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would extract this to a separate private method. So the above logic can be simplified.
%i[read write].each do |mode| | ||
["#{mode}_transaction", "execute_#{mode}"].each do |method_name| | ||
define_method(method_name) do |**config, &block| | ||
if method_name.include? 'transaction' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is kind of backwards and sort of duplication.
I think in this case it would be better to have 2 separate method definitions. One with deprecation and another without.
super( | ||
->(tx) { Struct::Wrapper.new(reverse_check { block.call(tx) }) }, | ||
to_java_config(Neo4j::Driver::TransactionConfig, **config) | ||
).object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's increase our max line length to 160. That's what we have on all our projects.
|
||
check do | ||
super( | ||
->(tx) { Struct::Wrapper.new(reverse_check { block.call(tx) }) }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check if Struct::Wrapper is still required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, will check
No description provided.