• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate performance while executing underlying stored proc

 
Tejal Pande
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all

I need opinions/experiences of people using hibernate as ORM tool in terms of its performance. Here is the problem -

I have an DAO (Data access object) whose implementation is provided using hibernate APIs and JDBC APIs both. (XXDAOHibernateImpl and XXDAOJDBCImpl). There is a certain complex logic exists in my underlying database in terms of a stored procedures. XXDAOHibernateImpl uses a NamedQuery to execute the stored procedure. XXDAOJDBCImpl uses a callable statement to do the same.

There is a huge performance difference between hibernate and jdbc implementations! XXDAOHibernateImpl takes almost 5100 ms to complete and XXDAOJDBCImpl takes hardly 50 ms!! I am baffled as both of them use the same stored procedure!!! so why so much difference in timetaken?

Has anybody experienced this?

-Tejal
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you turned on Hibernate's debugging? Might be worth seeing what its up to, though I can't think of a reason why there would be such a difference.

Have you also tried profiling what is happening in the database? Its worth making sure that ultimately the same query is being run, and in the same way. If the only difference is Hibernate is having to wait a long time for a response then you can shift your attenting to the database itself.
[ February 27, 2007: Message edited by: Paul Sturrock ]
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you show the timing points in your code of this?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic