-
Notifications
You must be signed in to change notification settings - Fork 872
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
list<string> values not accessible #2478
Comments
Hi, @Test
public void testSetListProperty() {
OrientGraph g = new OrientGraph("plocal:target/databases/test-db", "admin", "admin");
if (g.getVertexType("PS") == null) {
g.createVertexType("PS");
}
Vertex v = g.addVertex("class:PS");
g.commit();
List<String> listProperty = new ArrayList<String>();
listProperty.add("s1");
listProperty.add("s2");
v.setProperty("lp", listProperty);
g.commit();
List<String> result = v.getProperty("lp");
Assert.assertEquals(2, result.size());
Assert.assertTrue(result.contains("s1"));
Assert.assertTrue(result.contains("s2"));
g.shutdown();
} it passes without problems could you modify this test in way which reflects your issue ? |
I have put couple of reloads @Test
public void testSetListProperty() {
OrientGraph g = new OrientGraph("plocal:target/databases/test-db", "admin", "admin");
if (g.getVertexType("PS") == null) {
g.createVertexType("PS");
}
Vertex v = g.addVertex("class:PS");
g.commit();
List<String> listProperty = new ArrayList<String>();
listProperty.add("s1");
listProperty.add("s2");
((OrientVertex) v).getRecord().reload();
v.setProperty("lp", listProperty);
g.commit();
((OrientVertex) v).getRecord().reload();
List<String> result = v.getProperty("lp");
Assert.assertEquals(2, result.size());
Assert.assertTrue(result.contains("s1"));
Assert.assertTrue(result.contains("s2"));
g.shutdown();
}
} everything is fine. |
Andrey, hi 1st request 2nd and 3d 4th As you see on 4th request we getting earliest record. Vertex are getting via code Database init OGlobalConfiguration.CACHE_LEVEL1_ENABLED.setValue(false); Regards, |
Hi Valentin, |
Yes, we are using plocal engine embedded database. After restart server, all records become to normal latest version state.
Regards, |
Good, could you try following: OGlobalConfiguration.CACHE_LEVEL2_ENABLED.setValue(false); It should fix your issue. |
Andrey, thank you very much. Looks like those settings solve the problem. Does disabling cache significantly reduce performance?
Regards, |
It depends, but we have direct memory cache instead of heap cache, so not so much. |
@valenpo can you also try to realod the record by using: ((OrientVertex)vertex).getRecord().reload(null, true); In this way you ignore cache on reloading. |
Luca, thanks I just follow Andrey recommendation and it fix the issue.
Regards, |
Hi
I am using Orient 1.7.2 with Blueprints 2.5.0. When I call
vertex.setProperty(key, value);
where value is a List, the data goes missing. I cannot retrieve it again.
More generally, some users, that certain vertexes are missing from the db. We're still busy investigating...
Here is our setProperty function:
@OverRide
public void setProperty(String key, Object value) {
if (key!=null && value!=null) {
int attempt = 0;
while(attempt<Database.MAX_ATTEMPTS) {
try {
vertex.setProperty(key, value);
((OrientVertex)vertex).getRecord().save();
((TransactionalGraph) database.getGraph()).commit();
break;
} catch(ONeedRetryException e) {
attempt++;
((OrientVertex)vertex).getRecord().reload();
if (attempt==Database.MAX_ATTEMPTS) {
logger.debug("cant save property to vertex and commit to db: "+e.getMessage());
}
}
}
}
}
@OverRide
public Object getProperty(String key) {
return vertex.getProperty(key);
}
The text was updated successfully, but these errors were encountered: