Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-25-2023 09:29 AM
Greetings. As the title states, I'm having trouble with the "findById" method from Neo4jRepository.
In my case, I have a pretty large graph which contains around 6k nodes. The problem comes when I use "findById" to retrieve the information of a single node. As far as I understand, "findById" retrieves not only the node I'm trying to get, but the whole set of "connected" nodes as well. I've reached a point in which my application fails with a "StackOverFlow" error, which I could infer was caused by a huge query made by SDN (I could tell this by taking a look at the query trace in console).
Now, I just "solved" this problem by increasing the JVM's stack size to 4M. My question is then: is this ok? I mean, it sounds a little bit odd to me having to tweak the default stack size. Also, although this works, some queries take up to 20s to complete..
All in all, is there a way to prevent "findById" from fetching the whole graph every time? I also found out that if I retrieve the node using a custom query, it ends up deleting previous relationships when executing .update(node) method.
It seems like the only way to work with Neo4jRepository's basic operations implies fetching and saving the whole graph each time, resulting in a huge performance loss.
I would appreciate some advice regarding this issue.
All the sessions of the conference are now available online