How do I recover from an application crash?
634004Apr 18 2008 — edited Apr 18 2008I have two applications running. Each application has their own monitor thread that cycles through lock_detect() and failchk(). Each application is reading and writing to the database just as fast as they can. When I kill one application via task manager, the second one deadlocks. I then periodically get the “Thread/process ####/#### failed: Thread died in Berkeley DB library”. This message is being output by the monitor thread when it calls failchk(). I catch the DbException with its error number set to DB_RUNRECOVER. At this time, my worker threads are still dead-locked apparently waiting for the crashed application to release its lock. If I attempt to recover my database by closing the connection and reopening it on the monitor thread, when I call dbp->close(), the monitor thread hangs. How should I go about recovering from this situation without actually having to bring down the current process?
Regards,
Todd