(change:major) Sleep some amount of time if an error is caught. This is a workaround and should be improved. For instance: how to check if DB is locked?