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

fixed few tests. moved reset to better place. #202

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

stefanak-michal
Copy link
Contributor

No description provided.

@stefanak-michal
Copy link
Contributor Author

Most important change is: I've removed calling reset in runStatement and I've added it into assertNoFailure. So for any call which ends in failure is automatically called. I believe that is desired, so the client would be able to recover by itself.

@stefanak-michal
Copy link
Contributor Author

I wrote you a message, here is a copy, which is a reason why I commented two tests.

I've discovered something interesting. When you try to call COMMIT on server in READY state (without opening transaction), it will generate FAILURE response. Which is correct. But RESET can't be send. On older neo4j versions it just does nothing and bolt get stuck on trying to read from empty buffer from db. on newer neo4j version (>=5.12) you get disconnected immediately by neo4j after that failure. You can't even reset, you just have to reconnect.
same with rollback

@stefanak-michal
Copy link
Contributor Author

stefanak-michal commented Apr 3, 2024

It was confirmed by Neo4j. I will update reading from Bolt on neo4j-php/Bolt#137 but it was suggested to follow server state. Therefore I'm thinking about checking server state in bolt methods in src/Bolt/BoltUnmanagedTransaction.php.

Don't merge this yet.

@stefanak-michal
Copy link
Contributor Author

okay @transistive , now it's ready. I had to upgrade something in bolt to properly handle server state. neo4j-php/Bolt#139

It's keeping track of open "streams". When you do multiple RUN in open transaction, each one has qid and you have to pull/discard by this qid. But while your transaction is open and you have some not consumed "streams", server state stays in TX_STREAMING. It's explained here https://www.neo4j.com/docs/bolt/current/bolt/message/#transaction in that second example.

Now it is ready for merge.

@transistive transistive merged commit 8335f8b into neo4j-php:ISSUE-198 Apr 5, 2024
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