Hibernate Native Method of Loader Class is consuming more time

“getRowFromResultSet” method of Loader Class is consuming more time for execution.

Is there any solution to optimize this method?

Hi,

You don’t provide enough information to decide if there’s a real problem or not. “More time” compared to what?

Did you make some profiling?

If you want us to help, we need more information.

Hello,
We have an banking application hosted on jboss server and we have a reporting module in the application, where we fetch the data from database.For fetching the data, we are using hibernate (hibernate3.jar,hibernate-commons-annotation.jar, hibernate-jpa-2.1-api.jar) i.e. three jar files.
We haven’t used any profiling for the same. When we are testing the application, we are monitoring the same in the APM tool (DYNATRACE), where we found that the Hibernate method getRowFromResultSet() is consuming more time.I have attached a snap for the same.After deep dive analysis, we found that the method is present inside the Hibernate3.jar (Loader.java).
Is there any alternative or solution, so that we can optimize the method so that time consumed is less for the same.

Please revert back asap.

Note:- We cannot update the jar file, even if we does update the latest version of hibernate(version 5) jar file, the method still persists in the jar file.

Capture

Hibernate 3 is 10 years old, and no longer supported. You should definitely try it with Hibernate 5.2 or 5.3.

Anyway, from the picture, I can tell that you are fetching a very large number of results, which is bad for performance. Use pagination if you plan on sending data to the UI or do the calculation on the DB instead of fetching millions of records just to aggregate them in Java.

Thank you for the suggestion.
We are observing this issue in reporting module where we cannot apply pagination.

Does upgrading hibernate version to 5.2 or 5.3 resolve the issue of multiple calls to getRowFromResultSet resulting in high execution time??
If so, we need a valid reason to prove the point.:slight_smile:

We are observing this issue in reporting module where we cannot apply pagination.

Yes, you can and you should use pagination. It’s just a matter of accommodating it properly in your design.

Does upgrading hibernate version to 5.2 or 5.3 resolve the issue of multiple calls to getRowFromResultSet resulting in high execution time??

As long as you are retrieving 1 million records from the DB, no upgrade will ever help you with that. Hibernate is constantly improved in terms of performance, so it could be more efficient for that particular use case. But it’s your responsibility to test it and decide if the upgrade works better for you.

Thanks for your suggestion.