-
Notifications
You must be signed in to change notification settings - Fork 22
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
tx_commit/1 doesn't appear to work, transactions generally wonky #12
Comments
Hi there - thank you for this report, I'll check again that part. What version of Neo4j, are you using for the tests? |
2.3.2 Community |
hmm, ok, I'll try that; I am using 3 |
I'll try updating to 3.x myself and see if that changes anything. |
not sure if that would change anything?! The issue you found probably has nothing to do with the Neo4j. |
Just tried with 3.0.3 and the same tests fail in the same way. I'm kinda HOPING it's just a problem with Neo4j.Sips, only because that would be a lot easier to fix. ;) |
:) Now I need a reliable test, to make sure I can reproduce the issue you found. |
Try the code in my fork? :) |
That's the one. :) |
This: |
Actually, they both fail at this point, at the point where I'm testing that the change made in the transaction is NOT visible to the "main connection" until the transaction is committed...
|
I only imported the |
Oh, cool. That's a good sign. Maybe I flubbed something up in trying to fix that "invalid query" error when calling tx_commit(conn)... (which is what that failing test is testing). |
This is what I have, so far:
|
Cool. I suspect the ultimate call to tx_commit(conn, "") is failing because the empty string is an invalid query. So when that actually gets called, the failure of the "empty string query" actually results in a rollback. |
Elixir 1.2.6? |
1.2.5, but hopefully that doesn't change much. |
nailed it. Please pull the code from the
and the server will basically not commit(close) the open transaction. Tricky to debug, but I found it. Please have a look and check if your tests are passing now, I'll clean up the (Query) code tomorrow and merge the code to Cheers! |
Whew, that's pretty crazy, glad I could help. If you've already pulled my Tx tests in, probably no need for a pull request at this point! ;) |
…ng open transactions, and transactions in general. Please see the issue described here: #12, for more details. This commit is code cleanup mostly. Thanks Paul, for catching and reporting this issue!
code is in the Thanks again, Paul! |
Something seems very wrong with transactions. I think part of it is code, part of it might be Neo4j itself, but I'm not sure. I've forked the repo and done a little twiddling in transaction.ex, and then added to the transaction test to see if the main Neo4j connection can "see" the transactional changes before they're committed -- unfortunately, that seems to be the case.
Please take a look at https://github.com/dotdotdotpaul/neo4j_sips
One problem I noticed is that if you call tx_commit(conn) (with nothing else), the code would generate a server error during the commit, because it tries to execute a statement "" (empty string). I think my refactoring fixed that (using nil to indicate "no statements") but I still kept getting some odd behavior with regards to things persisting after a rollback...
So I expanded the test to check to see if the Neo4j.conn "sees" the changes made by the transactional conn -- and it does. That's concerning. But I also can't tell if that particular problem is due to Neo4j or to something in this library...
...Paul
The text was updated successfully, but these errors were encountered: