| Using hibernate.enable_lazy_load_no_trans=true to enable lazy loading without an active transaction. Serializing a proxy, stores the session factory uuid to be used upon deserialization to get the session factory:
SessionFactoryImplementor sf = (SessionFactoryImplementor)
SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
If I try to deserialize the proxy in a different JVM (e.g. after restart), the session factory uuid will be different and deserialization will fail with NullPointerException because no session factory is found with old uuid. |