Comments (21)
Hi there - thank you for this report, I'll check again that part. What version of Neo4j, are you using for the tests?
from neo4j_sips.
code is in the master
, and is was just published to hex.pm moments ago
Thanks again, Paul!
from neo4j_sips.
2.3.2 Community
from neo4j_sips.
hmm, ok, I'll try that; I am using 3
from neo4j_sips.
I'll try updating to 3.x myself and see if that changes anything.
from neo4j_sips.
not sure if that would change anything?! The issue you found probably has nothing to do with the Neo4j.
from neo4j_sips.
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. ;)
from neo4j_sips.
:) Now I need a reliable test, to make sure I can reproduce the issue you found.
from neo4j_sips.
Try the code in my fork? :)
from neo4j_sips.
sure, looking at https://github.com/dotdotdotpaul/neo4j_sips/blob/master/test/neo4j_sips_transaction_test.exs
from neo4j_sips.
That's the one. :)
from neo4j_sips.
This: "commit statements in an open transaction"
, is the one failing, right?!
from neo4j_sips.
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...
pclegg:~/work/neo4j_sips (master)$ mix test
test/neo4j_sips_transaction_test.exs:75: warning: variable results is unused
.....
1) test rollback statements in an open transaction (Neo4j.Sips.Transaction.Test)
test/neo4j_sips_transaction_test.exs:29
Main connection should not be able to see transactional change
stacktrace:
test/neo4j_sips_transaction_test.exs:44
2) test commit statements in an open transaction (Neo4j.Sips.Transaction.Test)
test/neo4j_sips_transaction_test.exs:59
Main connection should not be able to see transactional change
stacktrace:
test/neo4j_sips_transaction_test.exs:71
.......
Finished in 0.9 seconds (0.1s on load, 0.7s on tests)
14 tests, 2 failures
Randomized with seed 447555
from neo4j_sips.
I only imported the test/neo4j_sips_transaction_test.exs
and didn't start changing my original code yet, I only have one test failing ATM, the one I mentioned above.
from neo4j_sips.
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).
from neo4j_sips.
This is what I have, so far:
~/alchemy_lab/neo4j_sips $ mix test test/neo4j_sips_transaction_test.exs
test/neo4j_sips_transaction_test.exs:75: warning: variable results is unused
..
1) test commit statements in an open transaction (Neo4j.Sips.Transaction.Test)
test/neo4j_sips_transaction_test.exs:59
Assertion with == failed
code: Enum.count(results) == 1
lhs: 0
rhs: 1
stacktrace:
test/neo4j_sips_transaction_test.exs:80
Finished in 0.1 seconds (0.1s on load, 0.04s on tests)
3 tests, 1 failure
from neo4j_sips.
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.
from neo4j_sips.
Elixir 1.2.6?
from neo4j_sips.
1.2.5, but hopefully that doesn't change much.
from neo4j_sips.
nailed it. Please pull the code from the tx_debug
branch, it should work now. You suspected the driver and the server too, and you were right :) On my side, I had a design issue. The Query will "auto-commit" any query executed in an open transaction. Neo4j also has a "specific" behaviour that I was not aware of; the docs are not exactly clear sometimes. Committing an open transaction with no params, must be treated a bit different otherwise Neo4j will simply not commit :( In my case, when committing a Tx i.e. Neo4j.tx_commit(conn)
, the driver will send an empty statement to the server:
{
"statements" : [ ]
}
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 master
. Taking a break now, and thanks so much for your findings. BTW, pls send any PR if need be, and I'll merge asap. Using your Tx tests from now on ;)
Cheers!
from neo4j_sips.
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! ;)
from neo4j_sips.
Related Issues (14)
- Multiple Endpoints HOT 6
- Injection? HOT 6
- abstractions for node/relationships HOT 24
- Cannot run anything from Neo4j.Sips HOT 4
- Can't connect to Neo4j after update from 3.0 to 3.1 HOT 15
- TODO List HOT 7
- ** (MatchError) no match of right hand side value: {:error, {:error, :invalid}} HOT 11
- Models: how to create properties on relationships HOT 4
- Basic auth doesn't seem to work properly? HOT 6
- Production? HOT 3
- getting hex dependency conflict HOT 3
- Ecto adapter HOT 6
- Cypher query builder HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neo4j_sips.