[hibernate-dev] exposing statistics easier (HHH-3593 solution)

Elias Ross genman at noderunner.net
Thu Nov 20 19:52:22 EST 2008


Spring and a lot of other containers like JBoss's Microcontainer make
it pretty easy to deploy the statistics MBean.

E.g. in Spring:

    <bean id="hibernateStatisticsService"
class="org.hibernate.jmx.StatisticsService">
        <property name="sessionFactory">
            <bean factory-bean="entityManagerFactory"
factory-method="getSessionFactory"/>
        </property>
    </bean>

  	<bean id="jmxBeanExporter"
class="org.springframework.jmx.export.MBeanExporter">
  		<property name="beans">
  			<map>
				<entry key=":type=HibernateStatisticsService"
value-ref="hibernateStatisticsService"/>
  			</map>
  		</property>
  		<property name="server" ref="platformMBeanServer"/>
  	</bean>

Probably it's more of a documentation issue to explain to users how to
do this than to provide a configuration facility.

I don't see this as hard as a user.



More information about the hibernate-dev mailing list