Skip to content

Decouple session from connection #215

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 3 commits into from
Mar 13, 2017

Conversation

lutovich
Copy link
Contributor

No description provided.

So it could later use it to obtain connections on demand rather than
hold a single connection permanently.
This commit effectively decouples session from connection. Session now
holds two `ConnectionHolder`s that lazily pick connection from the pool
when it is needed and try to release connection back to the pool when it
does not have any users. Session keeps one connection holder for read
connection and one for write connection.

Connection is acquired for `Session#run()` and released when the
returned result is either fully consumed or error happens. Also
connection is acquired for `Session#beginTransaction()` and released
when transaction commits or rolls back.
@oskarhane
Copy link
Member

lgtm!

@lutovich lutovich merged commit 0321198 into neo4j:1.2 Mar 13, 2017
@lutovich lutovich deleted the 1.2-decouple-conn-from-session branch March 13, 2017 15:28
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