Since it possible for one JVM process to write to Xodus and other JVM to read to the same environment, what is the correct way for a JVM process or method to remove the lock of the environment at end of every transaction as such other JVM processes would be able to write to the same environment at their own respective transactions?
Asked
Active
Viewed 107 times
1 Answers
1
The xd.lck
file is never being removed, it is being locked by an Environment which is allowed to write. For implementation details, look at LockingManager.
If one Environment is in write mode, it is possbile to open another one (and several such) in read-only listening mode against the same physical database:
final EnvironmentConfig config = new EnvironmentConfig().
setLogDataReaderWriterProvider("jetbrains.exodus.io.WatchingFileDataReaderWriterProvider");
final Environment env = Environments.newInstance(dir, config);
This way to open Environment can be used in the same or another JVM.

Vyacheslav Lukianov
- 1,913
- 8
- 12
-
So there's no way for two processes or two JVM to be able to write one after the other? I mean this the issue we face, once a process is spawned by the servlet container any other processes spawned by the same container cannot write to Xodus due to this lock, making Xodus unusable to such servlet environment. – quarks Jun 03 '20 at 14:56
-
I actually created an issue ticket related to this: https://youtrack.jetbrains.com/issue/XD-807 – quarks Jun 10 '20 at 20:37