Tomcat setup:
JAVA_OPTS=" -Dcom.sun.management.jmxremote.port=9002 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.awt.headless=true"
Spring config:
<bean id="jmxExporter" class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<entry key="Hibernate:name=statistics">
<ref local="statisticsBean">
</ref>
</entry></map>
</property>
</bean>
<bean id="statisticsBean" class="org.hibernate.jmx.StatisticsService">
<property name="statisticsEnabled">
<value>true</value>
</property>
<!-- Change this to match you own system if needed -->
<property name="sessionFactory"><ref local="sessionFactory"></ref>
</property>
</bean>
Hibernate property:
<prop key="hibernate.generate_statistics">true</prop>
No comments:
Post a Comment