zambranag
Aug 24th, 2005, 03:22 PM
I am trying to configured the HibernateService message bean using
an existent session factory, so that it can be managed remotetly.
however, there is not sessionFactory property to set, like there is in
the other Hibernate message bean, StatisticsService. From reading
the javadocs for HibernateService, it seems like this class creates
its own Session Factory, but it does not exposed it, I will like to
keep using the session factory I have created with LocalSessionFactoryBean.
Here is a the relevant Spring configuration:
<!-- Hibernate Session Factory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFac toryBean" lazy-init="false">
<property name="dataSource">
<ref local="dataSource"/>
</property>
<property name="mappingJarLocations">
<value>dbmaps.jar</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.max_fetch_depth">${hibernate.max_fetch_depth}</prop>
</props>
</property>
</bean>
<!-- ************** Hibernate JMX Beans **************** -->
<bean id="statisticsBean" class="org.hibernate.jmx.StatisticsService">
<property name="statisticsEnabled">
<value>false</value>
</property>
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>
thanks
Gustavo
an existent session factory, so that it can be managed remotetly.
however, there is not sessionFactory property to set, like there is in
the other Hibernate message bean, StatisticsService. From reading
the javadocs for HibernateService, it seems like this class creates
its own Session Factory, but it does not exposed it, I will like to
keep using the session factory I have created with LocalSessionFactoryBean.
Here is a the relevant Spring configuration:
<!-- Hibernate Session Factory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFac toryBean" lazy-init="false">
<property name="dataSource">
<ref local="dataSource"/>
</property>
<property name="mappingJarLocations">
<value>dbmaps.jar</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.max_fetch_depth">${hibernate.max_fetch_depth}</prop>
</props>
</property>
</bean>
<!-- ************** Hibernate JMX Beans **************** -->
<bean id="statisticsBean" class="org.hibernate.jmx.StatisticsService">
<property name="statisticsEnabled">
<value>false</value>
</property>
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>
thanks
Gustavo