So in my persistence.xml I turned on hibernate.generate_statistics.
<property name="hibernate.generate_statistics">true</property>
My question is.. how do I access them? Where do the statistics go?
So in my persistence.xml I turned on hibernate.generate_statistics.
<property name="hibernate.generate_statistics">true</property>
My question is.. how do I access them? Where do the statistics go?
i would rather use Hibernate Statistics published via JMX if you use spring you can make it real easy with Hibernate Statistics MBean with Spring
In your dao service you can go:
Session session = this.sessionFactory.getCurrentSession();
SessionStatistics sessionStats = session.getStatistics();
Statistics stats = this.sessionFactory.getStatistics();