My guess would be the performance of either with relation to large objects would be fairly insignificant when compared with the expense of the database access itself, or in other words I'm not sure it is a meaningful metric to decide between the two. Which suits your needs more? Which one's concepts are you more comfortable with?
Ashutosh Gawande wrote:I think ORM frame work doesn't make sense to me when we want to just retrive some data, plain JDBC / spring + jdbc should give better performance
Joined: Aug 19, 2009
As you will not be going through the extensive lines of code written to parse the data obtained, by hibernate to some plain object.
ORM only make sense if you have mid sized domain model with complex relationships like agressions, associations, lazy loading etc. If the model is simple/small the only thing helpful is you don't have to write dao code and sqls, but thats not so bad when you have smaller domain model.
If your domain model were very basic then yes I agree, an ORM may be overkill, but not for performance reasons. I'd be very surprised if you saw much more than a small, perhaps even negligible difference between Hibernate and JDBC for loading what I assume to be LOBs or similar data types. The bottleneck in both cases is still the database round trip, not what happens to the data after it has been retrieved.
Of course, if you access this data repeatedly, Hibernate will probably show better performance because it comes with caching by default.