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

Add ability of checking if result handle is open #1194

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

injectives
Copy link
Contributor

@injectives injectives commented Mar 23, 2022

This update introduces a new method to result handles for checking if result is open:

  • Result.isOpen()
  • ResultCursor.isOpenAsync()
  • RxResult.isOpen()

Result is considered to be open if it has not been consumed via the consume method and its creator object (e.g. session or transaction) has not been closed (including committed or rolled back).

Attempts to access data on closed result will produce {@link ResultConsumedException}.

Implementation is based on existing internal logic.

@injectives injectives marked this pull request as draft March 23, 2022 00:01
@injectives injectives changed the title Feature/open Add ability of checking if result handle is open Mar 23, 2022
This update introduces a new method to result handles for checking if result is open:
- `Result.isOpen()`
- `ResultCursor.isOpenAsync()`
- `RxResult.isOpen()`

Result is considered to be open if it has not been consumed via the consume method and its creator object (e.g. session or transaction) has not been closed (including committed or rolled back).

Attempts to access data on closed result will produce {@link ResultConsumedException}.

Implementation is based on existing internal logic.
@injectives injectives marked this pull request as ready for review March 23, 2022 11:49
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.

LGTM (the all time classic, but we did actually discuss this).

@injectives injectives merged commit 80a6333 into neo4j:5.0 Mar 23, 2022
@injectives injectives deleted the feature/open branch March 23, 2022 15:11
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