No answer at all?
On Friday, July 24, 2015 at 3:15:04 PM UTC+2, Alicia Lobo wrote:
>
> It gets even better: I'm getting the following exception:
>
> com.orientechnologies.orient.core.exception.OStorageException: Cannot
> open local storage 'ow' with mode=rw
> at com.orientechnologies.orient.core.storage.impl.local.
> OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:220) ~[na:na
> ]
> at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open
> (ODatabaseDocumentTx.java:244) ~[na:na]
> at com.orientechnologies.orient.core.db.
> OPartitionedDatabasePool$DatabaseDocumentTxPolled.internalOpen(
> OPartitionedDatabasePool.java:137) ~[na:na]
> at com.orientechnologies.orient.core.db.OPartitionedDatabasePool.
> openDatabase(OPartitionedDatabasePool.java:331) ~[na:na]
> at com.orientechnologies.orient.core.db.OPartitionedDatabasePool.acquire(
> OPartitionedDatabasePool.java:304) ~[na:na]
> at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<init>(
> OrientBaseGraph.java:166) ~[na:na]
> at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.<init>(
> OrientTransactionalGraph.java:78) ~[na:na]
> at com.tinkerpop.blueprints.impls.orient.OrientGraph.<init>(OrientGraph.
> java:128) ~[na:na]
> at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getTx(
> OrientGraphFactory.java:74) ~[na:na]
> ...
> ... 7 common frames omitted
> Caused by: com.orientechnologies.orient.core.exception.
> OSerializationException: Cannot load database's configuration. The
> database seems to be corrupted.
> at
> com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.load(OStorageConfigurationSegment.java:84)
>
> ~[na:na]
> at
> com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:166)
>
> ~[na:na]
> ... 34 common frames omitted
> Caused by: java.io.IOException: The process cannot access the file because
> another process has locked a portion of the file
> at java.io.RandomAccessFile.read0(Native Method) ~[na:1.7.0_71]
> at java.io.RandomAccessFile.read(RandomAccessFile.java:330) ~[na:1.7.0_71]
> at
> com.orientechnologies.orient.core.storage.fs.OAbstractFile.openChannel(OAbstractFile.java:641)
>
> ~[na:na]
> at
> com.orientechnologies.orient.core.storage.fs.OAbstractFile.open(OAbstractFile.java:144)
>
> ~[na:na]
> at
> com.orientechnologies.orient.core.storage.impl.local.OSingleFileSegment.open(OSingleFileSegment.java:57)
>
> ~[na:na]
> at
> com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.load(OStorageConfigurationSegment.java:64)
>
> ~[na:na]
> ... 35 common frames omitted
>
> Here's what happens:
>
> - ODatabaseDocumentTx has a field has a field storage. In my case
> storage is a OLocalPaginatedStorage (I'm using a plocal database).
> - OLocalPaginatedStorage has a field configuration (inherited from
> OStorageAbstract). In my case configuration is a
> OStorageConfigurationSegment.
> - OStorageConfigurationSegment has a field segment, of type
> OSingleFileSegment.
>
> The problem occurs when OAbstractPaginatedStorage.open() does:
>
> configuration.load():
>
> This causes the configuration to attempt:
>
> segment.open();
>
> which will throw this exception...
>
> java.io.IOException: The process cannot access the file because another
> process has locked a portion of the file
>
> ...if the file is already open (according to the error message, if it's
> locked by another process; I cannot verify this because the method that
> ultimately fails, java.io.RandomAccessFile.read0(), is native).
> It took quite a lot of debugging to find out who may be causing this and
> even now I cannot be 100% sure, but here's what I found:
>
> The database I got from the factory like this...
>
> ODatabaseDocumentTx database = factory.getDatabase();
>
> ...does *not* close the configuration when I do database.close(). (Or
> rather, it tries but nothing happens).
> Here's ODatabaseDocumentTx.close():
>
> @Override
> public void close() {
> localCache.shutdown();
>
> if (isClosed())
> return;
>
> setCurrentDatabaseInThreadLocal();
> try {
> commit(true);
> } catch (Exception e) {
> OLogManager.instance().error(this, "Exception during commit of
> active transaction.", e);
> }
>
> if (status != STATUS.OPEN)
> return;
>
> callOnCloseListeners();
>
> if (currentIntent != null) {
> currentIntent.end(this);
> currentIntent = null;
> }
>
> status = STATUS.CLOSED;
>
> localCache.clear();
>
> if (!keepStorageOpen && storage != null)
> storage.close(); // <---------------------- this gets invoked
>
> ODatabaseRecordThreadLocal.INSTANCE.remove();
> }
>
> OStorageAbstract.close():
> public void close() {
> close(false, false);
> }
>
> OAbstractPaginatedStorage.close(boolean, boolean):
> public void close(final boolean force, boolean onDelete) {
> doClose(force, onDelete);
> }
>
> OAbstractPaginatedStorage.doClose(boolean, boolean):
> private void doClose(boolean force, boolean onDelete) {
> if (!force &&
> ...
--
---
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.