rdbms: Database::selectDB() update the domain and handle failure better