itSpice
Subscribe:       RSS    Twitter    EMail
 














Hibernate Vs JDBC Performance Comparison

By Pinaki Mukherjee

The Hibernate advantage over JDBC

Concurrency Support

In JDBC there is no check that always every user has updated data this check has to be added by the developer. Hibernate maintains this concurrency check using a version field.It checks this version field in the database table before every update operation.

So, if two users retrieve data from the same table and modify it and if one of them saves the modification, the version gets updated. Now when the second user tries to save his data hibernate doesn’t allow it because the data he retrieved was modified and his version doesn’t match with the version in the database.

Caching and Connection Pooling

In JDBC, caching and connection pooling is maintained by hand-coding. Hibernate provides excellent caching support and connection pooling for better application performance.

Transaction Management

In JDBC one has to explicitly handle transaction management in the code. Hibernate provides injected transaction management.

Programming Overhead

In JDBC one has to do a lot of coding in the form of SQL queries to handle persistent data in database. In Hibernate there is no need to write code in the form of SQL queries to save and retrieve the data, thus reduces programming overhead and development time.

Maintenance Costs

Applications using JDBC contain large amounts of code that handles database persistent data. This code is subjected to changes whenever there is a change in database table structure leading to high maintenance cost.

In Hibernate the actual mapping between database tables and program objects is done in a XML descriptor file. So any changes to a database table will only need a change in the XML file resulting in centralized maintenance and reduction of maintenance costs.

Pinaki Mukherjee

A tenacious and successful Software professional with full project life cycle and consulting experience in real-time and non-real-time finance, telecom and government projects.

An Oracle certified professional with extensive java experience and now a certified ScrumMaster.
Also experienced in product promotion and pre-sales consulting.

Article Source: http://EzineArticles.com/?expert=Pinaki_Mukherjee
http://EzineArticles.com/?Hibernate-Vs-JDBC-Performance&id=2325429


Tags: [ , , , , ]


Related Posts


Comments

9 Responses to “Hibernate Vs JDBC Performance Comparison”

  1. Ron Berger on November 30th, 2009 2:34 pm

    Did I miss the part where you talk about actual performance? The article title promises something about performance, but it doesn’t give any indicate that you actually wrote any code to test anything at all.

  2. aaa on November 30th, 2009 3:13 pm

    bunch of speculation and where pros and cons?

  3. Roman on November 30th, 2009 5:22 pm

    I was reading this article because of it’s title “Hibernate Vs JDBC Performance Comparison”. But there’s not a single performance issue discussed here. That’s the actual problem of Hibernate, almost anything else is fine and clear. Any chance you do a real performance comparison?

  4. Hibernate Vs JDBC Performance Comparison | itSpice.net Hello CMS - the best cms website on November 30th, 2009 5:26 pm

    [...] original post here:  Hibernate Vs JDBC Performance Comparison | itSpice.net By admin | category: net cms | tags: jdbc, performance | How to optimize Joomla 1.5.x | [...]

  5. madhu on November 30th, 2009 5:37 pm

    Hibernate becomes inferior to jdbc when the performace of accessing large amount of data accessed from the databse

  6. Ashitkin Alexander on November 30th, 2009 7:31 pm

    and there is performance comparison? such incredible professional and nothing interesting

  7. sunil on December 1st, 2009 7:41 am

    one of the worst articles i have read in recent times. –10

  8. Nesh Lalchandani on December 2nd, 2009 5:58 am

    I think the title should have been “Hibernate Vs JDBC” or “Hibernate and JDBC Comparison”

    The current title gives me the impression that some parallel tests were done on applications that runs on Hibernate and another one on JDBC.

    Still an informative article for newbies.

  9. nAn on January 18th, 2010 1:21 am

    I sure hope that all IT Spice articles aren’t as useless and misrepresenting as this so-called article is. Waste of time coming here.






Latest ArticlesLatest News