For a while when one firmware version was causing my Sage to suffer from database corruption on 1 in 4 connections, I used NickelMenu to trigger a reboot before connecting and to reconnect without needing to unplug. The reboot time was worth the time needed to restore the database.
The key for me was that every time calibre reported database corruption, looking in the .kobo directory on the Sage, I saw <databasename>.sqlite-wal (write ahead logging) and <databasename>.sqlite-shm (shared memory) files. When the database is closed, these file would be removed so this told me was that the Sage was not closing the databases before the USB connection was established. The reboot forced the database to close.
|