This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate & Spring performance problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate & Spring performance problem" Watch "Hibernate & Spring performance problem" New topic

Hibernate & Spring performance problem

Vasily Kukhta

Joined: Jan 17, 2009
Posts: 23


I have application which is using Hibernate 3.2.5 and Spring 2.5 to connect to DB2 9.5 database.
Hibernate configuration is described in my Spring configuration file, so i am using Spring to get Hibernate Session Factory.
All transactions are managed declaratively through Spring AOP API (not through AspectJ annotations, all configuration is in XML file).

My application has a performance problem: beginning a Hibernate transaction takes a lot of time:

As you can see from the log file, just opening JDBC connection to begin Hibernate transaction takes more than two seconds!

Part of my Spring application context is described below:

Does anybody know, is there any way to make Spring & Hibernate to work faster? Maybe i must add something to Spring configuration file?

Thanks in advance!

Best regards, Vasily.

Vasily Kukhta

Joined: Jan 17, 2009
Posts: 23
Thanks everybody, the problem is solved.

If somebody faces the same issue, stop using, because it doesn't support conection pooling. Use C3P0 instead to keep a pool of active JDBC connections, which can be used by Hibernate to begin transactions.

Best regards, Vasily.
I agree. Here's the link:
subject: Hibernate & Spring performance problem
It's not a secret anymore!