Skip to content
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

Call close with the appropriate flag to commit or rollback on UnmanagedTransaction where possible to avoid double state acquisition #1065

Merged
merged 2 commits into from
Nov 10, 2021

Conversation

injectives
Copy link
Contributor

Calling close instead of separate isOpen and commitAsync requires less lock acquisitions and is safer.

Copy link
Contributor

@michael-simons michael-simons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add to the commit message

Call close with the appropriate flag to commit or rollback on UnmanagedTransaction where possible to avoid double state aquisition.

Otherwise looks great.

…edTransaction where possible to avoid double state acquisition

Calling `close` instead of separate `isOpen` and `commitAsync` requires less lock acquisitions and is safer.
@injectives injectives changed the title Call close on UnmanagedTransaction where possible Call close with the appropriate flag to commit or rollback on UnmanagedTransaction where possible to avoid double state acquisition Nov 10, 2021
@injectives injectives merged commit bef5547 into neo4j:4.4 Nov 10, 2021
@injectives injectives deleted the feature/async branch November 10, 2021 14:16
injectives added a commit to injectives/neo4j-java-driver that referenced this pull request Nov 11, 2021
…edTransaction where possible to avoid double state acquisition (neo4j#1065)

* Call close with the appropriate flag to commit or rollback on UnmanagedTransaction where possible to avoid double state acquisition

Calling `close` instead of separate `isOpen` and `commitAsync` requires less lock acquisitions and is safer.

* Update tests
injectives added a commit to injectives/neo4j-java-driver that referenced this pull request Nov 11, 2021
…edTransaction where possible to avoid double state acquisition (neo4j#1065)

* Call close with the appropriate flag to commit or rollback on UnmanagedTransaction where possible to avoid double state acquisition

Calling `close` instead of separate `isOpen` and `commitAsync` requires less lock acquisitions and is safer.

* Update tests
injectives added a commit that referenced this pull request Nov 11, 2021
* Make UnmanagedTransaction return ongoing tx completion stage (#1057)

This update ensures that `UnmanagedTransaction` returns existing on-going tx completion stage when a similar request is made. For instance, if it was requested to be rolled back and then requested to be closed, both invocations should get the same on-going stage. In addition, it should not accept conflicting actions, like committing and rolling back at the same time.

In addition, it makes sure that cancellation on reactive transaction function results in rollback.

* Call close with the appropriate flag to commit or rollback on UnmanagedTransaction where possible to avoid double state acquisition (#1065)

* Call close with the appropriate flag to commit or rollback on UnmanagedTransaction where possible to avoid double state acquisition

Calling `close` instead of separate `isOpen` and `commitAsync` requires less lock acquisitions and is safer.

* Update tests
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