It's the responsibility of the processes (and/or threads of control) using a Berkeley DB environment to ensure recovery is never performed if there are other processes running recovery or using an existing database environment. It would be great if Berkeley DB could solve this, but it requires a way to single-thread execution on a system, and there's rarely anything Berkeley DB can use for that purpose -- let alone a portable method.
Most application suites solve this problem by writing a tiny watch program that recovers the database environment and then runs the processes that actually use the database environment to perform work. The watcher program then monitors the working processes, and if any of them exit badly for any reason, the watcher kills any remaining processes and restarts the cycle.
Copyright Sleepycat Software