• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate: Performance issue vs JDBC

 
Sverre Moe
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My company uses Hibernate alot, but for some batch applications it seems like the general consensus is that JDBC would offer better performance when dealing with a large data set. I myself have not run any benchmarking on this subject, but I can understand that raw JDBC calls could be faster. Hibernate on the other hand ommit the need to write the SQL queries.

Is there any tweaks on Hibernate to increase performance with large data sets?
[ June 03, 2008: Message edited by: Sverre Moe ]
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, remember that all calls to Hibernate get translated to JDBC before they go to the database. Hibernate and JDBC are tied pretty closely together.

Having said that, there are always optimizations that people that know SQL well can do to make their database queries hum. Hibernate doesn't invalidate the JDBC Java packages, so you can always call JDBC code alongside Hibernate code, so long as you're careful.

Hibernate does have batch methods, such as executeUpdate and executeDelete that optimize batch operations.

Having said that, sometimes, using ETL tools or just database tools for importing or exporting large datasets can provide optimizations over using any Java program, whether it uses Hibernate, JDO, CMPs or just straight JDBC.

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic