Child edge created between 2 parent edges causes NPE when one of the parent vertex is deleted

24 views
Skip to first unread message

nagaraja sosale ramaswamy

unread,
Apr 10, 2015, 1:42:55 PM4/10/15
to orient-...@googlegroups.com
OrientDB allows to create an edge (child edge) between to edges, but when one of the vertices of the parent edges, the parent edge gets deleted but leaves the child edge hanging at one end. Subsequently causes NPE when try to delete the hanging edge.
Though hanging edge can be deleted using 'unsafe' keyword, the behaviour is not consistent.


create class Person extends V
create class Car extends V
create class Owns extends E
create class ChildEdge extends E

create vertex Person set name="Alice" // @rid=#40:0
create vertex Car set model="Vento"

create vertex Person set name="Bob"
create vertex Car set model="Polo"

create edge Owns from (select from Person where name="Alice") to (select from Car where model="Vento") // @rid=#42:3
create edge Owns from (select from Person where name="Bob") to (select from Car where model="Polo") // @rid=#42:4

create edge ChildEdge from #42:3 to #42:4 // @rid=#45:0

delete vertex where name="Alice" // vertex gets deleted successfully, along with corresponding edge #42:3

select from ChildEdge // returns one result

----+-----+---------+-----+-----
#   |@RID |@CLASS   |out  |in
----+-----+---------+-----+-----
0   |#45:0|ChildEdge|#42:3|#42:4
----+-----+---------+-----+-----

delete edge ChildEdge

Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.select from ChildEdge

Error: java.lang.NullPointerException


Reply all
Reply to author
Forward
0 new messages