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 = SessionFactoryRegistry.INSTANCE.getNamedSessionFactory( name );
if ( result == null ) {
throw new InvalidObjectException( "Could not find a SessionFactory [uuid=" + uuid + ",name=" + name + "]" );
}
LOG.debugf("Resolved stub SessionFactory by name");
}
else {
LOG.debugf("Resolved stub SessionFactory by UUID");