When you operate in remote, it could be better to let the server to do this operation by using a SQL batch:
beginlet account = create vertex Account set name = 'Luke'let city = select from City where name = 'London'let edge = create edge Lives from $account to $citycommit retry 100return $edge For more information: https://github.com/orientechnologies/orientdb/wiki/SQL-batch Lvc@ On 2 July 2014 18:25, Brian O'Keefe <[email protected]> wrote: > I'm seeing this as well in v. 1.7.3 in a single threaded loading > application. However, since I am using the remote protocol, it appears > that maybe it is queuing things up on the server side? I am loading a list > of master records and adding edges to them (add vertex 1, add vertex 2, add > edges from vertex 1 -> 2, add vertex 3, etc.), so I am fairly certain 2 > separate modifications are never occurring on the same vertex explicitly, > but the bug with incrementing version on edge addition could be causing it. > > Exception in thread "main" > com.orientechnologies.orient.core.exception.OConcurrentModificationException: > Cannot UPDATE the record #17:1404695 because the version is not the latest. > Probably you are updating an old record or it has been modified by another > user (db=v2 your=v1) > at > com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage.updateRecord(OLocalPaginatedStorage.java:797) > at > com.orientechnologies.orient.core.db.raw.ODatabaseRaw.save(ODatabaseRaw.java:273) > at > com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeSaveRecord(ODatabaseRecordAbstract.java:1132) > at > com.orientechnologies.orient.core.tx.OTransactionNoTx.saveRecord(OTransactionNoTx.java:79) > at > com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:319) > at > com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:294) > at > com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:40) > at > com.orientechnologies.orient.core.db.ODatabaseRecordWrapperAbstract.save(ODatabaseRecordWrapperAbstract.java:292) > at > com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:320) > at > com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:257) > at > com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:56) > at > com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.updateRecord(OBinaryNetworkProtocolAbstract.java:314) > at > com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.updateRecord(ONetworkProtocolBinary.java:1343) > at > com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:309) > at > com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract.java:169) > at > com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:45) > > > > > On Tuesday, July 1, 2014 10:49:33 AM UTC-4, Андрей Логинов wrote: >> >> Hello, >> >> I'm trying to perform massive insertion of data into my database (v. >> 1.7.2). >> I have a class Location and one of it's properties locationId. >> Firstly I've added something about 50k vertexes of Location class (Lets >> call them 'CITIES'). Then I've added a unique index for this class: >> CREATE INDEX Location.locationId ON Location (locationId) unique >> >> After that I'm starting adding 600k new Location class vertexes (lets >> call them ZIP_CODES). As we have rather limited system resources, we >> decided to add these postal codes by 50k batches one after another, each in >> separate java process. Zip codes depends from cities. There should be an >> edge between them, so index for locationId is required. Each 50k Locations >> also have 500k dependent vertexes and edges total linked to them. >> Each batch make orient db to consume additional 300-400mb memory which it >> doesn't seem to return :(. >> >> When memory consumption is near to it's limit (I allocated 3GB for >> OrientDB), I start getting a very surprising error (sometimes it is a batch >> 200-250k or 250-300k): >> >> APPLOG: 2014-07-01 16:07:31,885 ERROR [com.efinancialcareers.locations. >> export.job.ExportLocationsJob] - <Exception in thread "main" com. >> orientechnologies.orient.core.exception.OConcurrentModificationException: >> Cannot UPDATE the record #12:289185 because the version is not the >> latest. Probably you are updating an old record or it has been modified by >> another user (db=v2 your=v0)> >> APPLOG: 2014-07-01 16:07:31,885 ERROR [com.efinancialcareers.locations. >> export.job.ExportLocationsJob] - < at com.orientechnologies.orient.c >> ore.storage.impl.local.paginated.OLocalPaginatedStorage.updateRecord( >> OLocalPaginatedStorage.java:818)> >> APPLOG: 2014-07-01 16:07:31,885 ERROR [com.efinancialcareers.locations. >> export.job.ExportLocationsJob] - < at com.orientechnologies.orient.c >> ore.storage.impl.local.paginated.OLocalPaginatedStorage.commitEntry( >> OLocalPaginatedStorage.java:2110)> >> APPLOG: 2014-07-01 16:07:31,885 ERROR [com.efinancialcareers.locations. >> export.job.ExportLocationsJob] - < at com.orientechnologies.orient.c >> ore.storage.impl.local.paginated.OLocalPaginatedStorage.commit( >> OLocalPaginatedStorage.java:1099)> >> APPLOG: 2014-07-01 16:07:31,885 ERROR [com.efinancialcareers.locations. >> export.job.ExportLocationsJob] - < at com.orientechnologies.orient.c >> ore.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:132)> >> APPLOG: 2014-07-01 16:07:31,885 ERROR [com.efinancialcareers.locations. >> export.job.ExportLocationsJob] - < at com.orientechnologies.orient.c >> ore.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:105)> >> >> >> *There is no other thread which could change any record. Moreover I'm >> doing this all in scope of a single transaction. So I have no idea why this >> error appears. Please advise me something... * >> I've looked through the >> https://code.google.com/p/orient/wiki/TroubleshootingJava and >> https://code.google.com/p/orient/wiki/GraphDatabaseRaw#ConcurrencyGraphDB >> and before accessing the graph I'm disabling mvcc. I'm also trying to >> improve memory consumption and speedup the initialization process using >> next command: >> >> graph.getRawGraph() >> .setValidationEnabled(false) >> .setRetainRecords(false) >> .setMVCC(false) >> .declareIntent(new OIntentMassiveInsert()); >> >> However I can't even be sure that it helps! Should these settings be >> applied to client side app to the server itself? >> > -- > > --- > 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.
