-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Switching from dbcp to c3p0
PostPosted: Mon Apr 28, 2008 8:19 pm 
Newbie

Joined: Wed Nov 08, 2006 2:30 pm
Posts: 6
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.