Error handling for locked databases.