Skip to content

Propagate not consumed failures when closing session and transaction #423

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 7 commits into from
Oct 19, 2017

Conversation

lutovich
Copy link
Contributor

No description provided.

@lutovich lutovich requested a review from zhenlineo October 19, 2017 08:23
This commit aligns behaviour of `Session#close()` and `Session#closeAsync()`
so that later one also waits for the latest result to be fully fetched.
It makes possible to consume result after session is closed and allows
propagation of query errors in `#closeAsync()`. Errors are propagated
only if they were not consumed by reading the result cursor.
Made transaction state enum responsible for knowing if transaction is
open or closed. This seems prettier than large boolean expression.
This commit makes transactions surface unconsumed query errors when
doing commit or rollback. It's achieved by keeping track of all result
cursors and polling them for unconsumed failures when doing
commit or rollback.
Calls `StatementResult#summary()` and `StatementResultCursor#summaryAsync()`
should propagate unconsumed query errors. They are in this sense same as
`#consume()` and `#consumeAsync()` respectively. Previously summary calls
simply ignored existing unconsumed failure. This commit makes them propagate
it instead. Note that it's later still possible to access summary after
failure is consumed.
When closing sessions and committing/rolling back transactions.
Previously only last async cursor failure was propagated. This
means successfully completed cursors could hide not consumed
failures from previous queries.

This commit makes session and transaction track all results and query
them for not consumed errors when session is closed or transaction
either committed or rolled back.
Replaced anonymous classes with lambdas, made some tests use
existing driver instead of creating a new one.
@lutovich lutovich force-pushed the 1.5-consume-failures-when-tx-close branch from 448a0cd to cc6e520 Compare October 19, 2017 09:28
@zhenlineo zhenlineo merged commit f55cbcd into neo4j:1.5 Oct 19, 2017
@lutovich lutovich deleted the 1.5-consume-failures-when-tx-close branch October 19, 2017 14:03
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