Skip to content

Improve Session#reset() & cleanup of Connection#release() #427

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

Merged
merged 2 commits into from
Nov 16, 2017

Conversation

lutovich
Copy link
Contributor

@lutovich lutovich commented Nov 13, 2017

Based on #426

@lutovich lutovich requested a review from zhenlineo November 13, 2017 13:18
@zhenlineo
Copy link
Contributor

LG

@lutovich lutovich force-pushed the 1.5-session-reset-release-resources branch 2 times, most recently from 0328dbc to 0cd953a Compare November 16, 2017 14:13
Previously it tried to first release connection and then mark existing
transaction as terminated. This could've been problematic because it
allowed transaction to be used on the client after RESET, which clears
connection state on the server.

This commit makes `Session#reset()` first mark existing transaction as
terminated and only then release the connection. Releasing connection
implies RESET.
Replaced `Connection#releaseInBackground()` and `Connection#releaseNow()`
with single `Connection#release()`. Two old methods only differed in
return type. New method returns a `CompletionStage` which can either
be ignored or chained, if needed.
@lutovich lutovich force-pushed the 1.5-session-reset-release-resources branch from 0cd953a to 5a174eb Compare November 16, 2017 14:19
@lutovich lutovich merged commit ea3ca44 into neo4j:1.5 Nov 16, 2017
@lutovich lutovich deleted the 1.5-session-reset-release-resources branch November 16, 2017 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants