boolean reloaded = false;
for (int retry = 0;; retry++) {
try {
final OrientEdge e = g.addEdge(id, vOut, vIn, label);
addInCache(vOut.getProperty(keyFieldName), vOut);
addInCache(vIn.getProperty(keyFieldName), vIn);
edgesCreated.incrementAndGet();
return e;
} catch (OConcurrentModificationException e) {
concurrentException.incrementAndGet();
reloadVertices(vOut, vIn, label, retry, e);
reloaded = true;
} catch (ORecordDuplicatedException e) {
indexUniqueException.incrementAndGet();
reloadVertices(vOut, vIn, label, retry, e);
reloaded = true;
} catch (Exception e) {
unknownException.incrementAndGet();
OLogManager.instance().warn(
this,
"Error on addEdge(" + id + "," + outVertex + "," + inVertex + "," + label + "), retrying (retry=" + retry + "/"
+ maxRetries + ") Thread: " + Thread.currentThread().getId());
e.printStackTrace();
}
}
} finally {
g.shutdown();
endAsynchOperation();