[英]trying to Configur c3p0 pooling in Hibernate using Spring WebFlow
I am Configuring the built-in c3p0 pooling in Hibernate using Spring but its giving me error it does not like any of the C3P0 stuff like: 我正在使用Spring在Hibernate中配置内置的c3p0池,但是它给我带来了错误,它不喜欢任何C3P0之类的东西:
<prop name="hibernate.c3p0.min_size" value="2" />
<prop name="hibernate.c3p0.max_size" value="5" />
Can someone please tell me why? 有人可以告诉我为什么吗?
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<!--suppress InjectionValueTypeInspection -->
<property name="mappingResources" ref="hibernateMappingList" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">net.sf.hibernate.dialect.Oracle9Dialect</prop>
<prop key="transaction.factory_class">
net.sf.hibernate.transaction.JDBCTransactionFactory
</prop>
<prop key="hibernate.transaction.factory_class">
net.sf.hibernate.transaction.JDBCTransactionFactory
</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">false</prop>
<prop key="hibernate.jdbc.batch_size">0</prop>
<prop name="hibernate.c3p0.min_size" value="2" />
<prop name="hibernate.c3p0.max_size" value="5" />
<prop name="hibernate.c3p0.timeout" value="600" />
<prop name="hibernate.c3p0.max_statements" value="0" />
<prop name="hibernate.c3p0.idle_test_period" value="300"/>
<prop name="hibernate.c3p0.acquire_increment" value="1" />
</props>
</property>
</bean>
Here is my database source information: 这是我的数据库源信息:
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<!-- these are C3P0 properties -->
<property name="acquireIncrement" value="${database.acquireIncrement}" />
<property name="minPoolSize" value="${database.minPoolSize}" />
<property name="maxPoolSize" value="${database.maxPoolSize}" />
<property name="maxIdleTime" value="${database.maxIdleTime}" />
<property name="driverClass" value="${database.driver}" />
<property name="jdbcUrl" value="${database.url}" />
<property name="user" value="${database.user}" />
<property name="password" value="${database.password}" />
</bean>
The XML is wrong. XML错误。 In the following section 在以下部分
<prop name="hibernate.c3p0.min_size" value="2" />
<prop name="hibernate.c3p0.max_size" value="5" />
<prop name="hibernate.c3p0.timeout" value="600" />
<prop name="hibernate.c3p0.max_statements" value="0" />
<prop name="hibernate.c3p0.idle_test_period" value="300"/>
<prop name="hibernate.c3p0.acquire_increment" value="1" />
replace it using the same format as with the other properties 使用与其他属性相同的格式替换它
<prop key="key">value</prop>
The prop
element uses different attributes than the property
element. prop
元素使用与property
元素不同的属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.