Performance: ResultSetWrapperProxy.locateCorrespondingColumnIndexMethod() should use a cache for column methods

Description

Profiling our database access shows that a lot of execution time is consumed while detecting the column method via reflection multiple times in ResultSetWrapperProxy.locateCorrespondingColumnIndexMethod(). Especially if a lot of result set columns are involved.

This improvement suggestion use a cache instead of detecting the column method over and over again.
Find a patch for Hibernate version 4.2.20 attached. A cache class IntMethodCache is hocked into ResultSetWrapperProxy. The cache fills lazy and reduce the number of Class#getMethod calls to a minimum.

The same issue tackled with but is only fix with 5.3.2

Environment

Hibernate 4.2.20
DBMS: Oracle and SQL Server

Assignee

Unassigned

Reporter

Joerg Schweikert

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure