hi there,
I would like to swtich from dbcp to c3p0. We have some trouble with our application. From time to time (once a week) it just hangs for around three minutes. I can wait until the system recovers or go in a restart tomcat, both solves the problem. But naturally I need to get rid of the problem.
One possible culprit is dbcp. I would like to switch it out against c3p0. I read the c3p0 doc and the hibernate doc, but I am still not sure how I switch. Some basic tips would be highly appreciated.
The system runs in a Tomcat 5.5.25, Java 1.5 and Hibernate 3.2.5 environment.
Here is the relevant context.xml snippet
Code:
<Resource name="jdbc/accoloprd" auth="Container"
type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@192.168.20.230:1521:prd"
username="lalala" password="lalala"
maxActive="60" maxIdle="10" maxWait="-1"
accessToUnderlyingConnectionAllowed="true"
removeAbandoned="true"
removeAbandonedTimeout="60"
logAbandoned="true"
validationQuery="select * from dual"
testOnBorrow="true" />
Code:
<session-factory>
<property name="connection.datasource">java:comp/env/jdbc/accoloprd</property>
<!--property name="show_sql">true</property-->
<!--property name="dialect">org.hibernate.dialect.Oracle9Dialect</property-->
<property name="dialect">com.accolo.glue.hibernate.Oracle10DialectExtended</property>
<property name="SetBigStringTryClob">true</property>
<property name="batch_size">20</property>
<property name="max_fetch_depth">3</property>
<property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
<property name="cache.use_query_cache">true</property>
<property name="generate_statistics">true</property>
... and then the links to the mapping files
Here are my specif questions:
Do I need to put the c3p0 jar file in the lib path? What do I need to change in the config files. How do I now if I successfully switch the pooling provider? What logging setting in the log4j.prop file do I need to enable?
Thanks in advance.