[hibernate-dev] Proxying the Session: a requirement ?

Sanne Grinovero sanne at hibernate.org
Fri Mar 9 08:04:46 EST 2018


It turns out that using Bridger to restore backwards binary
compatibility will make the Session un-proxable.

Specifically any code attempint to invoke something like:

Session wrapped = (Session) Proxy.newProxyInstance(
      Session.class.getClassLoader(),
      new Class[] { Session.class }
      wrapper
);

will fail at runtime, as the JDK Proxy utility can't deal with bridge methods.

We do proxy the Session in some of our own code - which is of course
something that could be resolved with alternatives - but I wonder if
this approach will break many more frameworks and tools I'm not aware
of.

What do you all think, is this a deal breaker? I'm starting to think
the cure is worse than the disease :/

Thanks,
Sanne


More information about the hibernate-dev mailing list