[hibernate-dev] Narrowed HibernateProxy and Uninitialized bytecode-enhanced entities do not get detached

Gail Badner gbadner at redhat.com
Fri Oct 18 17:48:14 EDT 2019


Hi,

I seem to remember this topic came when we were working on the
enhancement-as-proxy feature.

Basically, EnhancementAsProxyLazinessInterceptor#session does not get
nullified when the PersistenceContext gets cleared.

As a result, such an entity can still get initialized if
the SharedSessionContractImplementor is still open.

I also noticed that narrowed proxies are never added to the
PersistenceContext, but they still have a reference to
the SharedSessionContractImplementor from which the narrowed proxy
originated. These references never get nullified either.

I believe these are both bugs, and I would like to address them.

Please let me know if I'm missing something here.

Thanks,
Gail


More information about the hibernate-dev mailing list