Slow performance using Hibernate APIs

I have a Java application using Hibernate to communicate with a MsSQL 2005 server driver net.sourceforge.jtds 1.2.4.

Everything works, but the performance is terrible . I suspect that the index is not used for queries sent to it, since the response time is proportional to the number of records in the table.


I wrote a small test application that uses the same driver (jtds) but does not use Hibernate, and I was able to reproduce poor performance (or, as I suppose). When I use prepared statements, I see the same poor performance as using Hibernate (response time ~ 1 s), but when my productivity is small (~ 10 ms).

I can get the same good performance using a method Hibernate executeSqlinstead of an interface Criteria, but I want to avoid this, as I want the code to remain modular and also the results not be transformed into my entity class.

Is there a way to have good performance with Hibernate, while using the aggregated backend method for creating queries and converting the results into objects of an object class?

+3
source share
1 answer

Microsoft? . . .

SO : hibernate SQL Server

+2

All Articles