I am migrating my project from Hibernate 4.1 to 5.1. While doing the upgrade, I found out that ConnectionProxyHandler and other proxy classes present in package 'org.hibernate.engine.jdbc.internal.proxy' have been removed along with the package in Hibernate 4.2. Can someone please explain what the reason is? What were the advantages and disadvantages of using these proxy classes, and why were they removed?
Trace from the commit log , ConnectionProxyHandler
and its proxy friends are removed in this commit on 15-Jan-2013 because of the JIRA issue HHH-7902.
The advantage is to improve the performance :
Originally, JDBC types (Connection, Statement, ResultSet, etc.) were wrapped with Java Proxies to introduce resource management, logging, etc. The proxying was shown to be a performance hotspot, so they were entirely removed. The functionality was replaced with a new set of internal contracts/helpers.