Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
368 views
in Technique[技术] by (71.8m points)

Spring data neo4j SDN 6

In SDN 6, @Deapth annotation is removed, and also in the latest 6.0.3, support for bi-directional relationship is added. Earlier it was giving StackOverflow while persisting a 2-way relation between the same node entities. For eg A-follows->B and B-follows->A. Now, this type of relationship is possible but when you load the Node with find* methods, it gets overly slow because of the nested relation, and also Depth is removed so it loads the entire relationship. Do we have any workaround on this?

question from:https://stackoverflow.com/questions/65941539/spring-data-neo4j-sdn-6

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I'm facing the exact same issue. Apparently, there is no workaround that I've found so far. The query keeps running and eventually fails with Outofmemory error.

The issue happens because of the self reference. This appears to be a defect since the self-reference nodes appear to be the ideal use case for graphs whereas they break while trying to find the nodes. Here is my query that is generated by SDN:

MATCH (n:Part) WHERE n.sku = "SKU000009"  WITH n, id(n) AS __internalNeo4jId__ RETURN n{.allowCustomerReviews, __nodeLabels__: labels(n), __internalNeo4jId__: id(n), __paths__: [p = (n)-[:SOLD_BY|GROUPED_WITH|PART_OF|FITS_INTO]->()-[:SOLD_BY|GROUPED_WITH|PART_OF|FITS_INTO|MANUFACTURED_BY*0..]-()-[:MANUFACTURED_BY*0..1]->()-[*0..]-() | p]}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...