The old dbcp (1.2.2 is used in broadleafdemo) is less robust than c3p0.
http://stackoverflow.com/questions/520585/connection-pooling-options-with-jdbc-dbcp-vs-c3p0
Will do some performance testing with dbcp 1.4.
1. Open broadleafdemo.war\WEB-INF\applicationContext-demo.xml
2. Modify your webDS and webStorageDS beans
2a. change the class to com.mchange.v2.c3p0.ComboPooledDataSource
2b. change property name to driverClass (from driverClassName)
2c. change property name to jdbcUrl (from url)
2d. change property name to user (from username)
<bean id="webDS" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="com.mysql.jdbc.Driver" />
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/broadleaf" />
<property name="user" value="user" />
<property name="password" value="password" />
</bean>
<bean id="webStorageDS" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="org.mysql.jdbc.Driver" />
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/broadleaf" />
<property name="user" value="user" />
<property name="password" value="password" />
</bean>
3. Download c3p0 from http://sourceforge.net/projects/c3p0/files/latest/download , extract, and copy c3p0-xxxx.jar (c3p0-0.9.1.2.jar at the time of this writing) into broadleafdemo.war\WEB-INF\lib
4. (Optional) You can also remove commons-dbcp.jar from broadleafdemo.war\WEB-INF\lib as it's no longer used.
References:
http://stackoverflow.com/questions/3002899/spring-configuration-of-c3p0-with-hibernate
http://stackoverflow.com/questions/520585/connection-pooling-options-with-jdbc-dbcp-vs-c3p0
http://sourceforge.net/projects/c3p0/
3. Download c3p0 from http://sourceforge.net/projects/c3p0/files/latest/download , extract, and copy c3p0-xxxx.jar (c3p0-0.9.1.2.jar at the time of this writing) into broadleafdemo.war\WEB-INF\lib
4. (Optional) You can also remove commons-dbcp.jar from broadleafdemo.war\WEB-INF\lib as it's no longer used.
References:
http://stackoverflow.com/questions/3002899/spring-configuration-of-c3p0-with-hibernate
http://stackoverflow.com/questions/520585/connection-pooling-options-with-jdbc-dbcp-vs-c3p0
http://sourceforge.net/projects/c3p0/
No comments:
Post a Comment