Skip to Main Content

Berkeley DB Family


For appeals, questions and feedback, please email

How do you know when to open an environment (DbEnv) with the DB_RECOVER flag?

User_S9HENDec 19 2022

I'm using the C++ BerkeleyDB API for an application.
Imagine that I open a new environment, start a new transaction, write something to the database using the transaction, and then kill the application before the transaction has been committed.
When I then re-open the database, any writes to the database will hang indefinitely, likely because there is a previous unfinished transaction. Opening the environment using the recovery flag solved the issue. How can I check if there are any of these unfinished transactions in order to know when to open the environment using the recovery flag?

Post Details
Added on Dec 19 2022