Create and delete an Edge to the same Vertex within an transaction fails without warning. [moved] #931

Closed
lvca opened this Issue Dec 10, 2012 · 0 comments

Projects

None yet

1 participant

@lvca
Owner
lvca commented Dec 10, 2012

This is Issue 931 moved from a Google Code project.
Added by 2012-07-03T12:28:40.000Z by rnest...@gmail.com.
Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Defect, Priority-Medium, Release

Original description

I have had some problems with modifying a graph structure within a transaction.
Especially when I have to remove and create Edges and modify Vertex content at the same time. 

The issue below is the first of my issues that I was able to reproduce with
a small test case.

<dependency>
    <groupId>com.orientechnologies</groupId>
    <artifactId>orientdb-graphdb</artifactId>
    <version>1.1.0-SNAPSHOT</version>
</dependency>

Didn't find a build.number file but the MANIFEST.MF file contains this information:
Implementation-Build: trunk@r5953
Implementation-Build-Date: 2012-06-30 18:58:19+0200

Steps to reproduce the problem:
0) create a Vertex class and a Edge class 
1) create three Vertexes A,B and C with Edges from A to B and from A to C
2) In a transaction: 
        add a new Edge between C and B 
        remove the Edge between A and B.
   This is in principle a move operation. 

Problem description:
a) The Edge between A and B is removed, but the Edge between C and B is not complete.
   C gets an out Edge, but B gets no in Edge. The Edge document is created.
   No exception is thrown.

2) Adding OGlobalConfiguration.CACHE_LEVEL1_ENABLED.setValue(false) creates another problem. 
   B actually gets the Edge from C but in addition it also has a null edge in the 'in' Edge set.
   No exception is thrown.

Noticed something odd; if you delete the A to B Edge before creating the C to B Edge 
everything works the way it should. I guess you agree that this should not make any 
difference when you use the API like this?

A test class is attached. Main looks like this:
GraphTest2 test = new GraphTest2();
try
{
    test.setup();
    test.initTest();
    test.runTest();
    test.printTest();
}
catch (Exception e)
{
    e.printStackTrace();
}
@lvca lvca closed this Oct 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment