This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes performance tuning of hibernate select query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "performance tuning of hibernate select query" Watch "performance tuning of hibernate select query" New topic

performance tuning of hibernate select query

Amitosh Mishra
Ranch Hand

Joined: Feb 11, 2010
Posts: 49
Hi all,
i am new to hibernate and i am trying to do some basic select operation on table i am able to do this but beginning the transaction is taking too much time.

below is my code


please let me know how can i optimize this.
it would be great if i get some documentation on hibernate performance tuning.

Bill Gorder

Joined: Mar 07, 2010
Posts: 1682

What are your metrics if you remove the system.out.println statements? Maybe do all of that at the end so it is not factoring into your times. Print lines can be slow depending on the environment. As far as query creation using named queries is faster as the query then only needs to be parsed once not each time it is called. This will save you if the query is used often. As for the query itself make sure your tables are indexed properly.

[How To Ask Questions][Read before you PM me]
Have you checked out Aspose?
subject: performance tuning of hibernate select query
It's not a secret anymore!