Skip to content

Use AccessMode correctly in NetworkSession #426

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 1 commit into from
Nov 14, 2017

Conversation

lutovich
Copy link
Contributor

NetworkSession acquires connections from the connection pool for the given access mode. Previously it tried to reuse existing connection when available. However, it did not pay attention to access mode when reusing connections. This could result in READ connection being used for WRITE operation and vice versa.

This PR fixes the problem by making session buffer existing result, if any. Buffering means that in-use connection will be released back to the pool. It also allows session propagate unconsumed failures from previous query executions.

`NetworkSession` acquires connections from the connection pool for the
given access mode. Previously it tried to reuse existing connection when
available. However, it did not pay attention to access mode when reusing
connections. This could result in READ connection being used for WRITE
operation and vice versa.

This commit fixes the problem by making session buffer existing result,
if any. Buffering means that in-use connection will be released back
to the pool. It also allows session propagate unconsumed failures from
previous query executions.
@zhenlineo
Copy link
Contributor

LG

@lutovich lutovich merged commit aac5738 into neo4j:1.5 Nov 14, 2017
@lutovich lutovich deleted the 1.5-access-mode-fix branch November 14, 2017 16:32
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