Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how do I see Hibernate summarized statistical information ?

 
Rod McLure
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I put this in hibernate config
<property name="hibernate.generate_statistics">true</property>

and i see this in log
15:41:28,153  INFO SettingsFactory:305 - Statistics: enabled

I put this in my log4j
log4j.rootLogger=info, stdout
log4j.logger.org.hibernate=INFO
log4j.logger.org.hibernate.SQL=TRACE
log4j.logger.org.hibernate.stat=TRACE

I can change these to get different logging output, so logging doesn't seem to be the problem

I see tons of  DEBUG SQL:111 followed by sql statement in the log
but I am not seeing any kind of statistical summary

I am using Hibernate 3.3 (ps. I did see one thread that mentioned statistics was fixed in 3.5)
Thanks
 
Tim Moores
Bartender
Posts: 3135
50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate statistics come in the shape of an MBean, so you need to use a JMX client to get at the data. Here's some information to get you started: http://raibledesigns.com/wiki/Wiki.jsp?page=HibernateJMX, but some googling will probably find more and more helpful information.
 
Rod McLure
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would certainly explain why I can't get it working.
I have googled this topic a lot and I have found the stuff about JMX
but i got the impression it was an option, (there is also a plugin to expose it to Jconsole)

I don't know how to link it here, but there was a post in this forum back in January
"Hibernate Performance Tuning Online Training question"

this thread had a response by Thorben Janssen with links
these links suggest all SQL will be logged at the end of a session just by setting
org.hibernate.stat=DEBUG
and having generate statistics=true


Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic