The field 'Company.companies' has been declared as LINKLIST but contains a null record (probably a deleted record?))
Deleting a single object can cause a chain of issues, because objects referencing the deleted object cannot be loaded, but also objects with references to an object with an reference to the deleted object, because the intermediate cannot be loaded, etc etc
So I need a way to prevent these deleted object from causing these issues in my database.
What I could do, is before deleting an object, search for all other objects referencing the record to be deleted, and removing all references.
I think that would work, but I'm not sure if that's the best way to do it, I'm thinking that there is something wrong in my design which causes this to be such an issue.
Also, I am aware that this issue could be solved by using the Graph interface, since links are two-way and automatically managed / updated in that case, maybe it's the best approach to switch to the Graph interface?
I would very much like to hear what the best or commonly accepted way to approach this issue is.
Thanks in advance for your replies!
Regards,
Sem
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
var log = [];
if(className == undefined) return "ERROR: missing className";if(limit == undefined) return "ERROR: missing limit";if(skip == undefined) return "ERROR: missing skip";
limit = parseInt(limit);skip = parseInt(skip);
if(limit <= 0 || limit > 1000) return "ERROR: limit out of bounds";if(skip < 0) return "ERROR: skip out of bounds";
var graph = orient.getGraph();var products = graph.command("sql", "select from "+className+" limit "+limit+" skip "+skip);
for(var i=0;i<products.length;i++){ var product = products[i]; var record = product.getRecord(); var propertyKeys = product.getPropertyKeys(); var iterator = propertyKeys.iterator();
while(iterator.hasNext()){ var key = iterator.next(); var type = product.getRecord().fieldType(key); if(type != null && type.getId() == 13){ if(product.getProperty(key) != null){ product.addEdge(key, product.getProperty(key)); } product.removeProperty(key); }else if(type != null && (type.getId() == 14 || type.getId() == 15)){ var list = product.getProperty(key); var listIterator = list.iterator(); while(listIterator.hasNext()){ var linkTo = listIterator.next(); if(linkTo != null){ product.addEdge(key, linkTo); } } product.removeProperty(key); } }}
return log;