if (result==null) {
// in case we were deserialized in a different JVM, look for an instance with the same name
// (alternatively we could do an actual JNDI lookup here....)
result = SessionFactoryObjectFactory.getNamedInstance(name);
if (result==null) {
throw new InvalidObjectException("Could not find a SessionFactory named: " + name);
}
else {
log.debug("resolved SessionFactory by name");
}
}