To start with, you could skip to code you've at start up.
Because as I read your post, the database crash several times a day, so it will quickly prove whether it is something in the code that is the reason, then if the database run a whole day without crashing, then it is the code.
Oh yeah I...