How to avoid a "database inaccessible" error?