{"action":"opened","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/3456","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/3456/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/3456/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/3456/events","html_url":"https://github.com/orientechnologies/orientdb/issues/3456","id":55380501,"number":3456,"title":"Lightweight Outgoing Edge Index Does Not Enforce Unique Constraint (OrientDB 2.0 Final)","user":{"login":"SDIPro","id":4164915,"avatar_url":"https://avatars.githubusercontent.com/u/4164915?v=3","gravatar_id":"","url":"https://api.github.com/users/SDIPro","html_url":"https://github.com/SDIPro","followers_url":"https://api.github.com/users/SDIPro/followers","following_url":"https://api.github.com/users/SDIPro/following{/other_user}","gists_url":"https://api.github.com/users/SDIPro/gists{/gist_id}","starred_url":"https://api.github.com/users/SDIPro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SDIPro/subscriptions","organizations_url":"https://api.github.com/users/SDIPro/orgs","repos_url":"https://api.github.com/users/SDIPro/repos","events_url":"https://api.github.com/users/SDIPro/events{/privacy}","received_events_url":"https://api.github.com/users/SDIPro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-24T18:42:54Z","updated_at":"2015-01-24T18:42:54Z","closed_at":null,"body":"This is a follow-up to my original issue report:\r\nhttps://github.com/orientechnologies/orientdb/issues/3442\r\n\r\nThe test case passes and throws an ORecordDuplicatedException if you add vertexInTwo to vertexOutTwo. However, if you add vertexInOne to vertexOutOne a second time, no exception is raised.\r\n\r\nHere's what I mean:\r\nvertexOutOne.addEdge(\"link\", vertexInOne);\r\nvertexOutOne.addEdge(\"link\", vertexInTwo);\r\nvertexOutOne.addEdge(\"link\", vertexInOne); <----- this never throws an ORecordDuplicatedException\r\n\r\nAlso, if you run the test case that throws the ORecordDuplicatedException against a plocal db, if you check the state of the database, vertexOutOne will be present but its out_link property will be null (or sometimes empty) while vertexInOne will still point to vertexOutOne, and vertexInTwo will still point to both vertexOutOne and vertextOutTwo. So, that's a problem if vertexOutOne is being created yet its out links to vertexInOne and vertexInTwo are lost.  I would expect none of the vertices to be created if an exception is thrown during commit.\r\n\r\nThis morning I tested this using real Edges and with the DB set to useLightweightEdges=false. The leftover, unlinked vertices problem occurs with real Edges as well.\r\n"}}