Forums Register Login

how do I see Hibernate summarized statistical information ?

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
Every plan is a little cooler if you have a blimp. And a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1379 times.
Similar Threads
Trying to get verbose log4j info
Hibernate 3 -> Logging queries to file with log4j
How to enable debug mode in logger(log4j)
what'a wrong woth my HQL query?????
can some one say what is wrong with my log4j.properties?
Log4j appender,stdout Error
Problem configuring Hibernate and JPA in Eclipse
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:56:15.