refactor ContextProvider and subclasses to support executing BeforeSaveEntity within Transaction boundary.