File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

performance tuning of hibernate select query

 
Amitosh Mishra
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

output


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

regards
Amitosh
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic