Search code examples
sqlgraphorientdbgraph-databases

Duplicated edges with the same @rid in OrientDB


I've discovered a strange behaviour when querying an Edge class using OrientDB (community-2.1-rc5). The database is returning the exact same edge with the exact same @rid and the exact same data, twice. My instinct says that this is a bug...

This is the query

SELECT FROM E WHERE @class='LIKES' AND (out IN [#12:0,#12:221]) AND in=#36:1913

And this is what orientDB studio returns

http://s29.postimg.org/hwruv0zif/Captura.png

This makes no sense. If I go to the vertex and query for LIKES relationship it only returns one registry... Anyone faced a problem like this?

This is the database I'm using if it helps

https://www.dropbox.com/sh/pkm28cfer1pwpqb/AAAVGeL1eftOGR4o0todTiAha?dl=0


Solution

  • To get help with this bug, you should make a request to join the google group. StackOverflow is not the best place to get help with this kind of bug.

    The problem is that you somehow duplicated your edge by mistake. Orientdb let you do it for some unknown reason.

    Here is the bug discussion on the orientdb google group : https://groups.google.com/forum/#!topic/orient-database/cAR7yUjCZcI

    In the discussion Luca(creator of orientdb) says this :

    "the problem is that without a transaction the creation of edge could
    be dirty. OrientDB tries to fix dirty reference, so maybe that's the 
    reason why the next time the exception is raised. I've changed the   
    default behavior of all SQL commands against Graphs to be always 
    transactional"
    

    Upgrading to the most recent version of orientdb would be good ideal. Maybe the bug has been fixed.