Skip to content

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

Merged
injectives merged 2 commits into
neo4j:4.4from
injectives:feature/async
Nov 10, 2021
Merged

injectives merged 2 commits into
neo4j:4.4from
injectives:feature/async

Conversation

@injectives

Copy link
Copy Markdown
Contributor

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

@michael-simons michael-simons left a comment

Copy link
Copy Markdown
Contributor

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