ssh2整合,一用c3p0就出错!
ssh2整合,不用数据连接池,完全正常;换c3p0就出错!而且启动服务慢,请求响应也很慢!
这个c3p0有什么猫腻?我在applicationContext.xml中如下配置:
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="classpath:dataSource.properties" /> </bean> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass"> <value>${datasource.driverClassName} </value> </property> <property name="jdbcUrl"> <value>${datasource.url} </value> </property> <property name="user"> <value>${datasource.username} </value> </property> <property name="password"> <value>${datasource.password} </value> </property> <property name="initialPoolSize"> <value>${jdbc.initialPoolSize} </value> </property> <property name="minPoolSize"> <value>${jdbc.minPoolSize} </value> </property> <property name="maxPoolSize"> <value>${jdbc.maxPoolSize} </value> </property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="mappingResources"> <list> <value>ssh2/login/model/User.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </prop> <prop key="show_sql">true</prop> </props> </property> </bean>