You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an SQL Update command is run using the Graph API connected to a remote database, the update saves to the database but when the vertex is retrieved using getVertex(rid), a stale version is retrieved. NOTE: This issue is not seen when running against a local database.
This has been observed in v2.1.x.
Here is a example code to reproduce there error:
OrientGraph g = factory.getTx(); // Using remote OrientGraphFactory (ie. remote:localhost/testdb)
OrientVertex v = g.addVertex(null);
v.setProperties("Counter", 0);
g.commit();
System.out.println(v.getProperties() + ", version=" + v.getRecord().getVersion());
v = g.getVertex(v.getId());
String cmd = String.format("UPDATE %s SET Counter = 10", v.getId());
g.command(new OCommandSQL(cmd)).execute();
v = g.getVertex(v.getId());
//v.reload();
System.out.println(v.getProperties() + ", version=" + v.getRecord().getVersion());
factory.close();
We will implement server-side transactions in the future, so this problem will be eventually fixed, but in the short term I think you will have to deal with this limitation.
When an SQL Update command is run using the Graph API connected to a remote database, the update saves to the database but when the vertex is retrieved using getVertex(rid), a stale version is retrieved. NOTE: This issue is not seen when running against a local database.
This has been observed in v2.1.x.
Here is a example code to reproduce there error:
If run as is output looks like:
{Counter=0, @Rid=#9:29, @Class=V}, version=1
{Counter=0, @Rid=#9:29, @Class=V}, version=1
If you uncomment the //v.reload output looks like:
{Counter=0, @Rid=#9:30, @Class=V}, version=1
{Counter=10, @Rid=#9:30, @Class=V}, version=2
The text was updated successfully, but these errors were encountered: