:-) We use Optimistic approach to avoid locks: http://en.wikipedia.org/wiki/Optimistic_concurrency_control
Lvc@ On 16 July 2014 09:51, Carsten Zerbst <[email protected]> wrote: > Hello, > > thanks for your answer, I'm using the TX loop with success. Looks terribly > similar to a solution we developed for distributed transaction > on ORACLE many years ago, but works :-) > > OConcurrentModificationException txException = null; > TX_LOOP: > for ( int txCount = 0; txCount < DBObjectManager.MAX_RETRIES; > txCount++ ) { > OrientGraph graph = ctx.getSession().getOrientDB().getTx(); > try { // Database > OrientEdge link = ctx.getDbObjectManager().findEdge( > graph, linkObjectId ); > > graph.removeEdge( link ); > graph.commit(); > txException = null; > > break TX_LOOP; > } catch ( OConcurrentModificationException exp ) { > LOG.info( "got concurrent modufication exception, > retry #" + (txCount +1) ); > txException = exp; > continue TX_LOOP; > } finally { > graph.shutdown(); > } > } > > if ( txException != null ) { > throw new IllegalStateException( "failed to CutLink", > txException ); > } > > > Am Dienstag, 15. Juli 2014 17:33:55 UTC+2 schrieb Carsten Zerbst: > >> Hallo All, >> >> I'm using the graph API and get OConcurrentModificationException. I >> tried to disable the local cache anc mvcc, but without result. >> I'm using version 1.7.4. >> >> *Setup:* >> >> Server started with -Ddb.mvcc=false -Dcache.local.enabled=false >> >> Client started with -Ddb.mvcc=false -Dcache.local.enabled=false >> >> *Java code:* >> >> OrientGraph graph = ctx.getSession().getOrientDB().getTx(); >> >> try { >> >> // Find parent and child based on unique attribute in DB >> OrientVertex parentVTX = ctx.getDbObjectManager().findVertex( graph, oid >> ); >> OrientVertex childVTX = ctx.getDbObjectManager().findVertex( graph, >> childOID ); >> >> OrientEdge edge = graph.addEdge( linkObjectId, parentVT, childVT, >> linkClassName ); >> >> // set some properties >> graph.commit(); >> >> } finally { >> graph.shutdown(); >> } >> >> *Error message:* >> >> com.orientechnologies.orient.core.exception. >> OConcurrentModificationException: Cannot UPDATE the record #11:10 >> because the version is not the latest. Probably you are updating an old >> record or it has been modified by another user (db=v26 your=v25) >> >> The record #11:10 is the record of the parent vertex. >> >> What could I do, to avoid this problem ? >> >> Thank you, Carsten >> > -- > > --- > You received this message because you are subscribed to the Google Groups > "OrientDB" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
