Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2115
  • Last Modified:

com.mchange.v2.c3p0.ComboPooledDataSource

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
prashubk
Asked:
prashubk
1 Solution
 
objectsCommented:
are you sure you are closing connections
0
 
Murali MurugesanFull stack Java developerCommented:
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
 
prashubkAuthor Commented:
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now