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

Introduce new managed transaction methods and deprecate existing ones #1196

Merged
merged 5 commits into from
Apr 4, 2022

Conversation

injectives
Copy link
Contributor

@injectives injectives commented Mar 24, 2022

This update introduces new methods for managed transactions, also known as transaction functions. Furthermore, it deprecates the existing methods.

The new methods are:

  • executeRead (synchronous and reactive), executeReadAsync (asynchronous)
  • executeWrite (synchronous and reactive), executeWriteAsync (asynchronous)
  • executeWriteWithoutResult (synchronous)

There are overloaded options that take transaction configuration.

The new methods do not permit explicit management (commit, rollback, close) of managed transaction. The driver will attempt committing the transaction as long as the provided unit of work completes successfully.

@injectives injectives marked this pull request as draft March 24, 2022 12:06
@injectives injectives force-pushed the feature/txf branch 6 times, most recently from dd182f9 to 61b4371 Compare March 30, 2022 16:20
@injectives injectives changed the title [WIP] Update tx functions - DO NOT MERGE Introduce new managed transaction methods and deprecate existing methods Mar 30, 2022
@injectives injectives marked this pull request as ready for review March 30, 2022 17:31
@injectives injectives changed the title Introduce new managed transaction methods and deprecate existing methods Introduce new managed transaction methods and deprecate existing ones Mar 30, 2022
@injectives injectives force-pushed the feature/txf branch 5 times, most recently from 670d8fa to d22493c Compare March 31, 2022 12:42
This update introduces new methods for managed transactions, also known as transaction functions. Furthermore, it deprecates the existing methods.

The new methods are:
- `executeRead` (synchronous and reactive), `executeReadAsync` (asynchronous)
- `executeWrite` (synchronous and reactive), `executeWriteAsync` (asynchronous)
- `executeWriteWithoutResult` (synchronous)

There are overloaded options that take transaction configuration.

The new methods do not permit explicit management (commit, rollback, close) of managed transaction. The driver will attempt committing the transaction as long as the provided unit of work completes successfully.
Copy link
Contributor

@gjmwoods gjmwoods left a comment

Choose a reason for hiding this comment

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

A nice simplification of the tx function API

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.

This is a great change to the surface of the driver, thank you for that!

I went in detail through all the JavaDoc. I appreciate the information about the semantics, it should go in a doc, too.

I annotated the blocking session with a couple of suggestions. Please apply them to the standard session and do the same for async and reactive.

Thank you.

driver/clirr-ignored-differences.xml Show resolved Hide resolved
driver/src/main/java/org/neo4j/driver/Session.java Outdated Show resolved Hide resolved
driver/src/main/java/org/neo4j/driver/Session.java Outdated Show resolved Hide resolved
driver/src/main/java/org/neo4j/driver/Session.java Outdated Show resolved Hide resolved
driver/src/main/java/org/neo4j/driver/Session.java Outdated Show resolved Hide resolved
driver/src/main/java/org/neo4j/driver/Session.java Outdated Show resolved Hide resolved
driver/src/main/java/org/neo4j/driver/Session.java Outdated Show resolved Hide resolved
driver/src/main/java/org/neo4j/driver/Session.java Outdated Show resolved Hide resolved
@injectives injectives merged commit 8b99dd1 into neo4j:5.0 Apr 4, 2022
@injectives injectives deleted the feature/txf branch April 4, 2022 16:49
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.

3 participants