ORM solutions (JPA; Hibernate) vs. JDBC ORM solutions (JPA; Hibernate) vs. JDBC spring spring

ORM solutions (JPA; Hibernate) vs. JDBC


We have similar experience comparing Hibernate with JDBC in batch mode (Statement#executeBatch()). Basically, it seems like Hibernate just doesn't do that well with bulk operations. In our case, the Hibernate implementation was fast enough on our production hardware.

What you may want to do, is to wrap your database calls in a DAO, giving your application a consistent way of accessing your data. Implement your DAOs with Hibernate where it's convenient, and with JDBC where the performance requirements call for it.


As a minimum, you need to do batch inserts in Hibernate: http://www.hibernate.org/hib_docs/reference/en/html/batch.html Saves a lot of round-trip time.

And, as Justice mentioned, the primary goal of Hib is not computer performance, but developer performance. Having said that, it's usually possible to achieve comparable (not equal, but not that much worse) to JDBC results.


Never use one technology for all problems.Depending on the problem decide what technology to use.Of course jpa or hibernate is slower than jdbc. jdbc is on lower level than jpa. Also a db professional with jdbc can write more optimized sql than jpa.If you gave critical point where speed is required, jpa is not your choise.