<!-- 连接池初始化连接数 -->
<property value="5" />
<property value="5" />
<property value="20" />
<!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。默认值: 3 -->
<property value="5" />
</bean>
<!-- 配置hibernate的SessionFactory -->
<bean
>
<!-- 注入数据源 相关信息看源码 -->
<property ref="dataSource" />
<!-- hibernate配置信息 -->
<property>
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
<!-- 开启二级缓存 ehcache -->
<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
<prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory_class}</prop>
<prop key="hibernate.cache.provider_configuration_file_resource_path">${hibernate.cache.provider_configuration_file_resource_path}
</prop>
</props>
</property>
<!-- 扫描hibernate注解配置的entity -->
<property value="com.entity" />
</bean>
<!-- 配置事务管理器 -->
<bean
>
<property ref="sessionFactory" />
</bean>
<!-- 配置事务增强处理Bean,指定事务管理器 -->
<tx:advice transaction-manager="transactionManager">
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-65857-8.html
9
但那时失败的实质性的原因至少有几个