Skip to content

Instantly share code, notes, and snippets.

@j5bot
Created March 17, 2014 21:45
Show Gist options
  • Save j5bot/9609066 to your computer and use it in GitHub Desktop.
Save j5bot/9609066 to your computer and use it in GitHub Desktop.
Customer 47: Reproduction of Insertion Bug
/*
* Insert a Transaction vertex
* Commit the graph
*
* Get the transaction vertex again
*/
OrientGraph orientGraph = ...;
OrientVertex transaction = orientGraph.addVertex(null);
transaction.setProperty("there", "yes");
logger.warn("id before commit: " + transaction.getId().toString());
orientGraph.commit();
logger.warn("id after commit: " + transaction.getId().toString());
String orid = transaction.getId().toString();
OrientVertex refetched = orientGraph.getVertex(orid);
logger.warn("refetched id: " + refetched.getId().toString());
orientGraph.shutdown();
try {
Thread.sleep(6000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment