orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

database.ocf (Access is denied) when creating schema

Open robert-andrei opened this issue 2 years ago • 0 comments

OrientDB Version: 2.2.37

Java Version: 11.0.13 OpenJDK

OS: Windows server 2019

I have a Java program which is creating the database schema executing the following commands from a script:

create class Uses extends E
create class UsesInternal extends Uses CLUSTERS 1
create class UsesSub extends UsesInternal CLUSTERS 1

Execution is like this:

graph.command(new OCommandScript("sql", scriptContent)).execute();

Expected behavior

Successfully create the schema every single time.

Actual behavior

Sometimes, a command execution fails with the following error:

com.orientechnologies.orient.core.exception.OPaginatedClusterException: Error during creation of cluster with name usesinternal
[...]
	at com.orientechnologies.orient.core.storage.impl.local.paginated.OPaginatedCluster.create(OPaginatedCluster.java:196) ~
Caused by: com.orientechnologies.orient.core.exception.OSerializationException: Error on update storage configuration
[...]
com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.update(OStorageConfigurationSegment.java:232)
Caused by: java.io.FileNotFoundException: C:\Program Files\Local Test\data\tmp\gdb\gdb-test\database.ocf (Access is denied)
	at java.io.RandomAccessFile.open0(Native Method) ~[?:?]
	at java.io.RandomAccessFile.open(Unknown Source) ~[?:?]
	at java.io.RandomAccessFile.<init>(Unknown Source) ~[?:?]
	at java.io.RandomAccessFile.<init>(Unknown Source) ~[?:?]
	at com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.update(OStorageConfigurationSegment.java:220)

Steps to reproduce

The issue is very inconsistent and only shows up from time to time. Didn't manage to pick up on a specific scenario. I'm not sure how the database.ocf file is used in Orient DB, is there something locking it?

robert-andrei avatar Mar 29 '24 13:03 robert-andrei