Ensure we work inside a session. Remove ref to the domain object factory from the loader.