Solved

com.mchange.v2.c3p0.ComboPooledDataSource

Posted on 2010-09-14
3
2,036 Views
Last Modified: 2013-11-24
Hi Experts,
             
                   i keep getting "Connection Time out" while obtaining a connection using following datasource setup. I open the connection,update a table immediately,close the connection ( no looping or no complex logic written after opening a connection).Not sure why.I'm not getting it consistently rather i get it once in a while.Experts please have your say on this and please guide me how to go about resolving this.
Or is there some property i'm missing from my datasource definition
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
                        <property name="driverClass">
                                    <value>${db.driver}</value>
                        </property>
                        <property name="jdbcUrl">
                                    <value>${db.connection.uri}</value>
                        </property>
                        <property name="user">
                                    <value>${db.username}</value>
                        </property>
                        <property name="password">
                                    <value>${db.password}</value>
                        </property>
                        <property name="initialPoolSize">
                                    <value>0</value>
                        </property>
                        <property name="minPoolSize">
                                    <value>0</value>
                        </property>
                        <property name="maxPoolSize">
                                    <value>80</value>
                        </property>
                        <property name="acquireIncrement">
                                    <value>1</value>
                        </property>
                        <property name="maxStatements">
                                    <value>4000</value>
                        </property> 
                        <property name="numHelperThreads">
                                    <value>11</value>
                        </property>
            </bean>

Open in new window

0
Comment
Question by:prashubk
3 Comments
 
LVL 92

Expert Comment

by:objects
ID: 33677876
are you sure you are closing connections
0
 
LVL 13

Accepted Solution

by:
Murali Murugesan earned 500 total points
ID: 33678606
try adding these properties,

<property name="acquireRetryAttempts" value="60"/>
<property name="acquireRetryDelay" value="1000"/>
<property name="breakAfterAcquireFailure" value="false"></property>
<property name="debugUnreturnedConnectionStackTraces" value="true"/>

Last one would help to identify if connection is leaked somewhere in the code.

-Murali*
0
 

Author Closing Comment

by:prashubk
ID: 33710702
Thanks all,Hi Murali i tried this in my local machine it dint time out.Let me see it in SIT and come back if i face this issue again.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to get all the API from website? 11 88
netstat -ano | find "8000" and taskkill /f /pid 2984 3 56
Eclipse with gitlab 1 40
maven module vs maven project 3 23
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question