OrientGraph graph;
try {
graph = new OrientGraph(dbUrl, user, password);
OrientUtils.importFromFile(graph, dumpFile);
letsWorkWithGraph(graph);
} finally {
graph.shutdown();
} public static void importFromFile(OrientGraph graph, String fileName) { ODatabaseImport importManager = null; OCommandOutputListener listener = new CollectOCommandOutputListener(); try { importManager = new ODatabaseImport(graph.getRawGraph(), fileName, listener); importManager.importDatabase(); importManager.close(); } catch (Exception e) { e.printStackTrace(); } }com.orientechnologies.orient.core.exception.OSchemaException: Cannot change the schema while a transaction is active. Schema changes are not transactional--
---
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 orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Riccardo,If you do need transactions, you can try commit transaction with RawGraph API, execute import and open new transaction.Best regards,Artem OrobetsOrient Technologies
the Company behind OrientDB
Orient Technologies
the Company behind OrientDBOrient Technologies
the Company behind OrientDBRunning it.celi.orient.util.ImportOrientTestcom.orientechnologies.orient.core.exception.ODatabaseException: Error on retrieving record #5:0 (cluster: ouser) at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.read(ODatabaseRaw.java:244) at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeReadRecord(ODatabaseRecordAbstract.java:682) at com.orientechnologies.orient.core.tx.OTransactionNoTx.loadRecord(OTransactionNoTx.java:63) at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.load(ODatabaseRecordTx.java:202) at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.load(ODatabaseRecordTx.java:38) at com.orientechnologies.orient.core.id.ORecordId.getRecord(ORecordId.java:296) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.fillSearchIndexResultSet(OCommandExecutorSQLSelect.java:822) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.searchForIndexes(OCommandExecutorSQLSelect.java:706) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.searchInClasses(OCommandExecutorSQLSelect.java:610) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLResultsetAbstract.assignTarget(OCommandExecutorSQLResultsetAbstract.java:137) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.assignTarget(OCommandExecutorSQLSelect.java:360) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.executeSearch(OCommandExecutorSQLSelect.java:338) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.execute(OCommandExecutorSQLSelect.java:327) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.execute(OCommandExecutorSQLDelegate.java:57) at com.orientechnologies.orient.core.storage.OStorageEmbedded.executeCommand(OStorageEmbedded.java:99) at com.orientechnologies.orient.core.storage.OStorageEmbedded.command(OStorageEmbedded.java:88) at com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.java:69) at com.orientechnologies.orient.core.sql.query.OSQLSynchQuery.run(OSQLSynchQuery.java:82) at com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQueryAbstract.java:29) at com.orientechnologies.orient.core.metadata.security.OSecurityShared.getUser(OSecurityShared.java:179) at com.orientechnologies.orient.core.metadata.security.OSecurityShared.authenticate(OSecurityShared.java:148) at com.orientechnologies.orient.core.metadata.security.OSecurityProxy.authenticate(OSecurityProxy.java:83) at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.open(ODatabaseRecordAbstract.java:128) at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:49) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.openOrCreate(OrientBaseGraph.java:885) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<init>(OrientBaseGraph.java:102) at com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx.<init>(OrientGraphNoTx.java:32) at it.celi.orient.util.ImportOrientTest.importOrientTest(ImportOrientTest.java:27) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)Caused by: com.orientechnologies.common.io.OIOException: You cannot access outside the file size (0 bytes). You have requested portion 0-2 bytes. File: File: ouser.0.ocl os-size=1001024, stored=1000000, filled=0, max=524287995 at com.orientechnologies.orient.core.storage.fs.OAbstractFile.checkRegions(OAbstractFile.java:514) at com.orientechnologies.orient.core.storage.fs.OFileMMap.readShort(OFileMMap.java:213) at com.orientechnologies.orient.core.storage.impl.local.OClusterLocal.getPhysicalPosition(OClusterLocal.java:287) at com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.readRecord(OStorageLocal.java:1800) at com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.readRecord(OStorageLocal.java:1157) at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.read(ODatabaseRaw.java:238) ... 56 more--