I need a way shutting down the Xodus environment so that
- It waits for all the writing transactions in all threads to finish (or be aborted after a timeout as an option).
- It blocks starting new transactions (or throws an exception as an option).
- Safely closes the environment.
So far we tried something like this
if (env.isOpen()) {
env.clear();
env.close();
}
but I am not sure that it does exactly the right thing, I still get exceptions thrown from env.close()
from time to time. So what is the proper way to do that?