Please see the discussion on https://github.com/hibernate/hibernate-orm/pull/820 and HHH-9487 for proper handling of SessionFactory serialization outside the JVM