Skip to content

Improve explicit transaction terminated state handling #1445

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 4 commits into from
Jul 5, 2023

Conversation

injectives
Copy link
Contributor

@injectives injectives commented Jul 1, 2023

An explicit transaction is considered terminated as soon as a failure occurs. Any usage of the terminated transaction and any of its results must be stopped and the transaction must be closed explicitly.

This update aims to ensure that the driver does not send further Bolt messages in regards to the terminated transaction.

In addition, a new TransactionTerminatedException class has been introduced. It is a subclass of the previously used ClientException, making this exception more specific. The exception will contain a non-null code if it is created based on the server's response. It will not have a code if it is generated by the driver. Depending on a failure cause, the result handles may emit other exceptions respectively, matching the driver's existing behaviour.

@injectives injectives force-pushed the feature/txt-n branch 5 times, most recently from e1613f7 to 89b0c0c Compare July 1, 2023 22:26
@injectives injectives changed the title Fix tx status handling Improve explicit transaction terminated state handling Jul 1, 2023
@injectives injectives force-pushed the feature/txt-n branch 6 times, most recently from a077644 to 855fa3c Compare July 4, 2023 10:07
An explicit transaction is considered terminated as soon as a failure occurs. Any usage of the terminated transaction and any of its results must be stopped and the transaction must be closed explicitly.

This update aims to ensure that the driver does not send further Bolt messages in regards to the terminated transaction.

In addition, a new `TransactionTerminatedException` class has been introduced. It is a subclass of the previously used `ClientException`, making this exception more specific. The exception will contain a non-null `code` if it is created based on the server's response. It will not have a code if it is generated by the driver. Depending on a failure cause, the result handles may emit other exceptions respectively, matching the driver's existing behaviour.
Copy link
Contributor

@bigmontz bigmontz left a comment

Choose a reason for hiding this comment

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

I approved with some comments. They are not blockers.

@injectives injectives merged commit 2220ba5 into neo4j:5.0 Jul 5, 2023
@injectives injectives deleted the feature/txt-n branch July 5, 2023 14:01
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