You can't. So far the only solution I've found that keeps me from getting database corruption is to restart my Kobos (especially the Sage which is my main reader) before connecting them to the computer. I also have daily backups of my database set up in the Customize plugin options of the Kobo Utilities plugin. Suspenders and belt rarely hurts.
So far since I started restarting before the initial connect, I haven't seen any instances of database corruption. By initial connect, I mean plugging my Kobo into the computer after using it for reading, etc. When I send books and do the second connection to send the metadata, I haven't needed to do the restart since the .sqlite-wal and .sqlite-shm files are not present when I telnet to my Kobo. Basically, seeing those files says that database is not properly closed and flushed to disk.
|