是否可以覆盖已存储在/tomcat/conf/server.xml中的Tomcat7 connectionTimeout属性。我的意思是在我的application-context.xml文件中设置一个属性,如
<bean id="dataSourceC3p0" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.driverClassName}" />
<property name="jdbcUrl" value="${jdbc.url}" />
<property name="user" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="maxPoolSize" value="20" />
<property name="maxStatements" value="0" />
<property name="minPoolSize" value="5" />
<property name="numHelperThreads" value="5"/>
<property name="connectionTimeout" value="200000"/>
</bean>
虽然,最后一行引发了错误:
org.springframework.beans.NotWritablePropertyException: Invalid property 'connectionTimeout'
当我只评论最后一个属性
时,所有其他属性都可以NotWritablePropertyException告诉我没有其他方法可以设置这个值吗?
感谢高级
答案 0 :(得分:0)
属性名称错误..
看看这个文档: http://www.databaseskill.com/4369778/
<! - When the connection pool is used when the client calls the getConnection ()
waiting to acquire a new connection timeout before throwing
SQLException, if set to 0 wait indefinitely. Milliseconds. Default: 0 ->
<property name="checkoutTimeout"> 100 </ property>
希望有所帮助