SessionFactoryImplementor sf = (SessionFactoryImplementor)
SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
SessionImplementor session = (SessionImplementor) sf.openSession();
try {
target = session.immediateLoad( entityName, id );
}
finally {
// make sure the just opened temp session gets closed!
try {
( (Session) session ).close();