-
Notifications
You must be signed in to change notification settings - Fork 871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception when adding an edge results in a non-existing Edge reference in the parent Vertex #1495
Comments
package test; import java.util.List; import com.orientechnologies.common.exception.OException; public class TestEdge
} package test; import java.util.List; import com.orientechnologies.common.exception.OException; public class TestThread implements Runnable
} |
Have you tried 1.4.0-SNAPSHOT? |
Did that just now. Downloaded today's source and ran the test, same problem. |
It actually behaves a bit different, now the parent document seems ok, but there is an extra edge in the in the E table and 'select from E' gives an NullPointerException. |
Versions:
orientdb-graphdb-1.3.0
orientdb-grahped-1.3.0 (server)
Problem:
I'm getting invalid (non existing) edge references in some of my vertexes, making the document inconsistent.
Setup:
My real environment is a large OSGi based application server, but I was able to simplify it down to
an application with one main and two threads.
I have one parent document that has two types of vertexes added to it on different intervals.
At one point I get the classic message:
"Cannot ? the record #10:0 because the version is not the latest. Probably you are using an old record or
it has been modified by another user (db=v40 your=v0)"
This is by itself not a problem, the problem however is that the exception causes a parent document being
updated with an edge-reference to a non-existing edge that was never created.
Test:
Parent class X
Child classes A and B, edge classes xa and xb
Create all classes and and instance of class X (parent).
Start two threads, one that adds A Documents and one that adds B documents.
Both uses the same X document as parent document, the parent document is fetched each time
Result:
starting test
TestThread starting: A
TestThread starting: B
adding vertex: B
adding vertex: A
adding vertex: B
adding vertex: A
adding vertex: B
adding vertex: A
adding vertex: B
adding vertex: B
adding vertex: B
adding vertex: A
adding vertex: A
adding vertex: B
Run ERROR:com.orientechnologies.orient.core.exception.OConcurrentModificationException: Cannot ? the record #10:0 because the version is not the latest.
Probably you are ing an old record or it has been modified by another user (db=v11 your=v0)
...
Check out edges for Parent document:
--> xa#13:0{out:#10:0,in:#11:0,label:xa} v1
--> xa#13:1{out:#10:0,in:#11:1,label:xa} v1
--> xa#13:2{out:#10:0,in:#11:2,label:xa} v1
--> xa#13:3{out:#10:0,in:#11:3,label:xa} v2
--> xa#13:4{out:#10:0,in:#11:4,label:xa} v2
--> xb#14:0{out:#10:0,in:#12:0,label:xb} v1
--> xb#14:1{out:#10:0,in:#12:1,label:xb} v1
--> xb#14:2{out:#10:0,in:#12:2,label:xb} v1
--> xb#14:3{out:#10:0,in:#12:3,label:xb} v1
--> xb#14:4{out:#10:0,in:#12:4,label:xb} v1
--> xb#14:5{out:#10:0,in:#12:5,label:xb} v1
--> #14:6 v0
REFERENCE TO AN EDGE THAT DOES NOT EXIST IN THE BASE!
done
OutEdges in the Parent document:
[#13:0, #13:1, #13:2, #13:3, #13:4, #14:0, #14:1, #14:2, #14:3, #14:4, #14:5, #14:6]
'select from E' does not contain #14:6
The text was updated successfully, but these errors were encountered: