生产环境中的休眠属性和会话问题

时间:2019-04-25 02:10:34

标签: hibernate system production

我在项目中使用了以下属性文件,但是在tomcat中部署项目后,应用程序在生产环境中可以正常运行2到4天,但是它停止响应应用程序用户生成的请求,并且我必须从tomcat重新加载应用程序,并且它可以正常工作2到4天,这些任务一次又一次地完成,请帮助。

<beans:bean id="sessionFactory"
        class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
        <beans:property name="dataSource" ref="dataSource" />
        <beans:property name="hibernateProperties">
            <beans:props>
                <beans:prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect
                </beans:prop>
                <beans:prop key="hibernate.show_sql">${hibernate.show_sql}</beans:prop>
                <beans:prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</beans:prop>

                <beans:prop key="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</beans:prop>
                <beans:prop key="hibernate.c3p0.idle_test_period">${hibernate.c3p0.idle_test_period}</beans:prop>
                <beans:prop key="hibernate.c3p0.acquire_increment">${hibernate.c3p0.acquire_increment}</beans:prop>
                <beans:prop key="hibernate.c3p0.min_size">${hibernate.c3p0.min_size}</beans:prop>
                <beans:prop key="hibernate.c3p0.max_size">${hibernate.c3p0.max_size}</beans:prop>
                <beans:prop key="hibernate.c3p0.max_statements">${hibernate.c3p0.max_statements}</beans:prop>
                <beans:prop key="hibernate.c3p0.timeout">${hibernate.c3p0.timeout}</beans:prop>

            </beans:props>
        </beans:property>


    </beans:bean>

0 个答案:

没有答案