just a step towards #25655 and some related refactoring
setting.Database.UseXXX
repo.GetOwner
repo.LoadOwner