• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

use hibernate on click of menu items?

 
Monica Shiralkar
Ranch Hand
Posts: 873
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it ok to use hibernate on click of menu items as data will come with delay first time. I am making an application where on the home page there is a menu. On clicking on menu data gets retrieved. Now this data gets retrieved first time bit slowly as I am using hibernate. Is it ok to use hibernate here and make the user wait few seconds on homepage itself?

thanks
 
Prasad Krishnegowda
Ranch Hand
Posts: 672
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What makes you think Hibernate is slow in retrieving data? Is your data so huge?
Are there multiple menu's user can choose or only 1 menu? and how are you thinking to make it faster second time onwards, through caching?
 
Dave Tolls
Ranch Hand
Posts: 2091
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would look into whatever query you are using, and the structure of the table (indexes for example).
Also look into what execution plan your db is using for the generated Hibernate query.
 
Monica Shiralkar
Ranch Hand
Posts: 873
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks all

What makes you think Hibernate is slow in retrieving data? Is your data so huge?
Are there multiple menu's user can choose or only 1 menu? and how are you thinking to make it faster second time onwards, through caching?


No not just in my case but generally. I have read the hibernate takes more time that JDBC query.However for subsequent requests it takes lesser time. So even if caching is there, the first time the user accesses the site, it will little slower than in case of JDBC.
 
Paul Clapham
Sheriff
Posts: 21554
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd say that basing your decision on unquantified rumours you have read somewhere online would be a very bad thing to do. Just because A is said to be "slower than" B is no reason to avoid A. For example maybe it's a millisecond slower in your environment, which would be completely unnoticeable. It's also possible that whoever said that "A is slower than B" was only looking at a small subset of cases and A would be faster than B in your environment. There's no way to tell unless you review those rumours and determine that they were in fact useful benchmarks, which are surprisingly uncommon.

So what you should do is what you were going to do in the first place, namely writing some ordinary and sensible code. If it turns out to be a performance problem once you've implemented it and tested it a bit then review the decision -- but tens of thousands of people have written applications using Hibernate and they were satisfied, so the chances of your Hibernate application being unsatisfactory are pretty small.
 
Monica Shiralkar
Ranch Hand
Posts: 873
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic