-
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
HIGH SEVERITY..I was able to retrieve an edge using graph.getVertex(edgeId)! (2.1.3) #5089
Comments
I checked in the code and there is this check:
Trying to create a new test case for it. |
@lvca Thanks for the quick response.. What I would expect in my case is |
@lvca I recreated piece by piece my database from scratch and I added a few vertices and an edge using the console and the same thing happens!
|
@zifnab87 How can I reproduce it? Do you have a script to generate it? |
Yeah I am able anytime.. give me some time I will send it :) |
Oct 10, 2015 4:56:10 PM com.orientechnologies.common.log.OLogManager log |
This test pass: @Test
public void edgesCannotBeVertices() {
OrientGraphNoTx gNoTx = new OrientGraphNoTx(URL, "admin", "admin");
try {
OrientVertex v = gNoTx.addVertex(null);
OrientVertex loadedV = gNoTx.getVertex(v.getIdentity());
try {
OrientEdge e = gNoTx.getEdge(v.getIdentity());
Assert.fail();
} catch (IllegalArgumentException e) {
// OK
}
} finally {
gNoTx.shutdown();
}
OrientGraph g = new OrientGraph(URL, "admin", "admin");
try {
OrientVertex v = g.addVertex(null);
OrientVertex loadedV = g.getVertex(v.getIdentity());
try {
OrientEdge e = g.getEdge(v.getIdentity());
Assert.fail();
} catch (IllegalArgumentException e) {
// OK
}
} finally {
g.shutdown();
}
} |
So at this point could be the remote connection, let me check it... |
Tested against remote, 2.1.x and develop branch and in all the cases a |
ok I will send it. @lvca could it be that you are not using specific vertex classes but the default ones?? your database should have already two vertex classes and an edge class.. |
Tried with specific vertex class and same result: everything works as expected: @Test
public void edgesCannotBeVertices() {
OrientGraphNoTx gNoTx = new OrientGraphNoTx(URL, "admin", "admin");
try {
gNoTx.createVertexType("TestV");
gNoTx.createEdgeType("TestE");
OrientVertex v = gNoTx.addVertex("class:TestV");
OrientVertex loadedV = gNoTx.getVertex(v.getIdentity());
try {
OrientEdge e = gNoTx.getEdge(v.getIdentity().toString());
Assert.fail();
} catch (IllegalArgumentException e) {
// OK
}
} finally {
gNoTx.shutdown();
}
OrientGraph g = new OrientGraph(URL, "admin", "admin");
try {
OrientVertex v = g.addVertex("class:TestV");
OrientVertex loadedV = g.getVertex(v.getIdentity().toString());
try {
OrientEdge e = g.getEdge(v.getIdentity());
Assert.fail();
} catch (IllegalArgumentException e) {
// OK
}
} finally {
g.shutdown();
}
} |
@lvca In your test case, I think you are checking the inverse thing to what is failing, as I said in this comment earlier (#5089 (comment)) I am requesting an edge through getVertex.. This is what fails.. The case you are testing worked for me yesterday.. I will check when i get home but if you can, please create an edge and then request it through getVertex() .. |
Got it, I think this is possible because we use Vertex as generic schema-less type, so I guess there is no check if the vertex is an edge. I can check on it, but my question is: why are you retrieving an edge as vertex? I mean, wha's the purpose and why it's so critical? Could you just retrieve it as edge with getEdge()? |
Well I didn't do it on purpose @lvca It happened in my code after a complicated insert.. In my models I keep a reference of a vertex about to be updated or just inserted.. For some reason after a specific (tested) use case that I add a big hierarchy of objects, I debugged it and I found an edge in the place of a vertex. This throws a NullPointerException because I try to use this "vertex" to find vertex properties that of course are not on the edge.. This is the bug that led me to find the bug we are currently discussing. That's why I am very frustrated. This is a case I have many passing integration tests and I haven't changed the code for quite a while yet it manages to fail when some of the nodes are newly inserted.. It is as if the clusters are messed up.. Yet the closed issue #5033 that I sent some code for you to replicate, makes my life really difficult since I cannot run all my tests at once |
@lvca this is definitely a bug I don't understand why cannot replicate was added.. I have moved away from OrientDB to TitanDB since December unfortunately. |
@zifnab87 You were right, added check. |
Possibly related/causing my other issues (#5068, #5033, #5048)
I stumbled upon that because it was giving a NullPointer exception trying to access properties that were not there.. The code was supposed to be retrieving a vertex but I debugged it and it was an edge retrieved as a vertex!
@lvca , @Laa This happens with any edges that I tried from two classes! I would appreciate it if you could investigate it as soon as possible - you already have my copy of db in the email. I almost switched to a different product and still thinking of it..
I checked with every single backup (about 20 of them) from the first one 4 months ago till the last one and all of them are behaving exactly the same way! I really don't know why my database became so messed up...so early on!
The text was updated successfully, but these errors were encountered: