Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-01-2022 01:28 AM
Hi!
I'm trying to provide a WCC (weakly connected components) analysis for my graph
It's very big. I'm trying to make a projection of my graph with
gds.graph.project.cypher(MY_QUERY)
But it doesn't work and returns the following:
Failed to invoke procedure `gds.graph.project.cypher`: Caused by: org.neo4j.graphdb.NotInTransactionException: The transaction has been closed.
And a funny moment is that when I manually reduce number of nodes in my projection it does work
So question 1
How can I avoid this error?
Question 2 (optional)
Further on, if my main graph gets some new relationships, do I have to start the whole procedure again? Or I can somehow use the results, computed 1 step before
Or maybe I should use something else?
Thank u in advance, badly need your help - I'm already about to give in
Solved! Go to Solution.
12-06-2022 10:40 AM
I don't see an obvious reason for an 'out of transaction' error. What happens when you run the node and relationship queries in the browser.
The only comment I have is I would think the 'with [a, a2] as a1' statement should follow the 'where' clause, as I would think the other variables the query references in the 'where' clause are out of scope when executed in this order. It's odd, but the query plan does show all the variables being projected through the 'with' clause.
12-06-2022 06:12 PM
I just thought of something. Your relationship query returns source and target ids in the second match of the union, but these don't correspond to the ids of the nodes related by a relationship. I don't think this is legit. Try your projection without this part of the relationship query.
That error is occurring in the gds library. It would occur if the code tries to access a node outside the transaction that was used to find the node.
12-05-2022 09:57 AM
Hello @Alexx
I found this other post with a similar error message and how to resolve it.
https://community.neo4j.com/t5/drivers-stacks/notintransactionexception-in-neo4j-4-0-3-embedded/m-p/...
Can you let me know if this helps you?
Thanks!
12-06-2022 12:45 AM
Hi, @TrevorS!
Thank you for reply
No, it doesn't help me.
The problem is that i'm bad at neo4j - not googling
Yeah, we have the same error msg, but am I using java? Can I break my request into parts to execute Weakly Connected Components algorithm?
I need just to make a projection for an existing graph. And there it fails
Maybe I still don't get smth?
Maybe I should give u more info about the code?
12-06-2022 04:55 AM
Can yo post your projection query that fails?
12-06-2022 07:03 AM
@glilienfield, Hi!
Yeah, sure, I'm afraid, it's a bit scary but I'll try to explain if you'd like to
12-06-2022 10:40 AM
I don't see an obvious reason for an 'out of transaction' error. What happens when you run the node and relationship queries in the browser.
The only comment I have is I would think the 'with [a, a2] as a1' statement should follow the 'where' clause, as I would think the other variables the query references in the 'where' clause are out of scope when executed in this order. It's odd, but the query plan does show all the variables being projected through the 'with' clause.
12-06-2022 01:53 PM
When i run both node and relationship, they work fine
Very slow, but still fine
And a funny thing by the way:
Before that I used to try to execute the same code, but instead of "taxi_type" i just passed the ids as an argument (via jupyter notebook)
And the projection did execute with a small amount of ids (about 100), and failed on bigger numbers(1000+)
I thought, the problem might be because of a huge length of argument, so I created those types directly on Neo
But still it fails ;(
And well, I actually don't even get the meaning of this error - if it didn't have enough space, ok, that would be clrear
But why the transaction is closed?)
12-06-2022 01:57 PM
Ah yeah, and I tried putting "with [a, a2] as a1" after where - still the same
12-06-2022 06:12 PM
I just thought of something. Your relationship query returns source and target ids in the second match of the union, but these don't correspond to the ids of the nodes related by a relationship. I don't think this is legit. Try your projection without this part of the relationship query.
That error is occurring in the gds library. It would occur if the code tries to access a node outside the transaction that was used to find the node.
12-06-2022 10:33 PM
@glilienfield, just to make sure I got you right: were you talking about this part of code?
12-06-2022 10:49 PM
And besides, I don't get how can that be:
"...source and target ids in the second match of the union, but these don't correspond to the ids of the nodes related by a relationship"
To me, I match all the nodes I'm interested in the first query, just as a set of nodes
And then I match the pairs of nodes (actually I don't need them to be oriented)
Or am I mistaken?
12-07-2022 01:52 AM
Yeah, @glilienfield, you were right!
I've changed the first parts of queries (before "UNION") and now that works!
So the problem was that I had several unused node ids that were not mentioned in relations?
But what if I wanted to scan any nodes without relations, to receive all components, even containing just 1 node?
Anyway, thank u so much!)
All the sessions of the conference are now available online