-
Notifications
You must be signed in to change notification settings - Fork 617
Relationships save takes long time (Neo4jTemplate 'saveAs' method) #2235
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
Comments
Thanks for reporting your problem.
|
Thanks for the response. P.S. >> Just a quick question. I guess it will be useful for everyone. Is it recommended to use Neo4j as OLAP db?? |
You should see something like
That basically boils it down to the duplication of the relationships. SDN assumes every time on save that the entity is new, because it does not have a version property and thus cannot determine if it is already present in the database or not. |
Update: The idea with externally generated ids is much worse regarding performance than the single save. Cannot put the finger on it right now but it is due to the amount of relationships. On the other hand saves of the individual entities (without relationships first) are much faster. |
We introduced some performance tweaks in the latest snapshot version ( |
Closing this because there were no response in the last three weeks. |
Hi.
Have models similar to these:
trying to save user object, but only want to save likes:
Have created an interface:
neo4jTemplate.saveAs(user, UserLikesMask.class);
What happens:
List<Like>
isSet<Like>
(both in User domain class and mask interface), an exception happens underneath the neo4jTemplate (it says: 'Cannot cast java.util.ArrayList to java.util.Set',, but I am not using ArrayList anywhere. So I guess maybe this is a bug)I have approximately 9000 users and 9000*40=360,000 LIKES relationships already (both users and likes have been created randomly just for testing).
Would be nice to be able to call "saveAs" and the system understands that if I provide only 40 relationships that means I want the user to have 40 relationships, not to have 80 or 120, etc. (that can happen if the system does not save with "append" mode and adding another new 40 relationships, but with "write" mode: erasing and saving. In that case I will always have 40 relationships) Maybe you can have some flag in saveAs method,, don't know )))
Also one mention. I am calling saveAs in the situation that both the user nodes and the movie nodes are already in the database.
Do you see issues?? Or am I doing smth wrong?? :)
Thank you in advance. :)
P.S. >> You are the best :) You are always ready to help with any topic :)
The text was updated successfully, but these errors were encountered: