Skip to content

Instantly share code, notes, and snippets.

@endymuhardin
Created July 28, 2012 06:31
Show Gist options
  • Save endymuhardin/3192099 to your computer and use it in GitHub Desktop.
Save endymuhardin/3192099 to your computer and use it in GitHub Desktop.
Hibernate Spring JMX
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
p:dataSource-ref="dataSource">
<property name="hibernateProperties">
<props>
<prop key="hibernate.generate_statistics">true</prop>
</props>
</property>
<property name="packagesToScan" value="com.artivisi.belajar.restful.domain" />
</bean>
<bean id="hibernateStatisticsMBean" class="org.hibernate.jmx.StatisticsService">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<context:mbean-server/>
<bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<entry
key="SpringBeans:name=hibernateStatisticsMBean"
value-ref="hibernateStatisticsMBean" />
</map>
</property>
</bean>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment