You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updating of existing MICO resources is unfortunately quite error prone because of the save approach of the Neo4j-OGM. If the particular entity that should be updated does not have all properties set, the relations are deleted.
Example: If a MICO service already has service interfaces and is updated without these service interfaces set, the relations to these nodes are deleted in the Neo4j database.
There are multiple ways to handle this:
Set the nested objects to the new entity before the save operation
Apply the new values directly from the DTO onto the existing entity from the database (see the MicoServiceDeploymentInfo resource as an example).
Change the depth of the save operation e.g. to 0. That won't delete any edge in the database. However that is not always possible because sometimes also the nested objects have to be updated (e.g. MicoServiceDeploymentInfo → depth of 1 would be necessary to updated the nested objects but can't be used because it has the potential of deleting the relation to the corresponding MicoService node). See issue Adjust DEPTH Parameter for Repository Save's Individually #646.
Currently we use a mix of these options. I recommend to not use option 1 anymore, because it is too error prone. Especially because sometimes the object should be updated with new relationships (must not be overwritten by the existing relationships) and sometimes only the simple values should be updated. I prefer to use both 2 and 3:
Limit the depth parameter where it is possible to a minimal value.
Use the request DTO in the Broker to be able to apply the new values directly onto the existing database entities (no danger to accidentally delete any existing relationships).
The text was updated successfully, but these errors were encountered:
Updating of existing MICO resources is unfortunately quite error prone because of the save approach of the Neo4j-OGM. If the particular entity that should be updated does not have all properties set, the relations are deleted.
Example: If a MICO service already has service interfaces and is updated without these service interfaces set, the relations to these nodes are deleted in the Neo4j database.
There are multiple ways to handle this:
MicoServiceDeploymentInfo
resource as an example).depth
of the save operation e.g. to 0. That won't delete any edge in the database. However that is not always possible because sometimes also the nested objects have to be updated (e.g.MicoServiceDeploymentInfo
→ depth of 1 would be necessary to updated the nested objects but can't be used because it has the potential of deleting the relation to the correspondingMicoService
node). See issue Adjust DEPTH Parameter for Repository Save's Individually #646.Currently we use a mix of these options. I recommend to not use option 1 anymore, because it is too error prone. Especially because sometimes the object should be updated with new relationships (must not be overwritten by the existing relationships) and sometimes only the simple values should be updated. I prefer to use both 2 and 3:
depth
parameter where it is possible to a minimal value.The text was updated successfully, but these errors were encountered: