Hi Margaret,

Thank you for your reply!!

We have already setup below parameters in jdbc-pool.html (see below) – could 
you please advise if we need to modify/add anything else here:

<p>And here is an example on how to configure a resource for JNDI lookups</p>
<div class="codeBox"><pre><code>&lt;Resource name="jdbc/TestDB"
          auth="Container"
          type="javax.sql.DataSource"
          factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
          testWhileIdle="true"
          testOnBorrow="true"
          testOnReturn="false"
          validationQuery="SELECT 1"
          validationInterval="30000"
          timeBetweenEvictionRunsMillis="30000"
          maxActive="100"
          minIdle="10"
          maxWait="10000"
          initialSize="10"
         removeAbandonedTimeout="60"
          removeAbandoned="true"
          logAbandoned="true"
          minEvictableIdleTimeMillis="30000"
          jmxEnabled="true"
          
jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;
            org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"
          username="root"
          password="password"
          driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:3306/mysql"/&gt;</code></pre></div>


Thanks and Regards,
Arpan

Arpan Halder
Tata Consultancy Services providing services to:
Global Data and Analytics
Application Support / ITAS
Route 22 West▪NJ 08876 ▪ USA
Mobile: +1 (908) 392 2947


From: Bauer, Margaret M (Peggy) [mailto:margaret.m.ba...@verizon.com]
Sent: Thursday, February 15, 2018 8:15 AM
To: Tomcat Users List <users@tomcat.apache.org>
Cc: Halder, Arpan [ITSUS Non J&J] <ahald...@its.jnj.com>; DL-MD-R&D-SUPPORT 
<DL-HCSUS-MD-R&d-supp...@its.jnj.com>
Subject: [EXTERNAL] Re: [E] Re: Cannot get a connection, pool error Timeout 
waiting for ideal object

Verify your max connection is set high enough for the amount of traffic you see 
in your access logs that would be making a call to the DB.  Possible code is 
not properly closing DB connections.  Remove abandoned connections.



add to your data source config

<Resource
        name="xxxxxxxxDS"
        auth="Container"
        url="jdbc:mysql://<FQDN>:3306/XXXXXX"
        driverClassName="com.mysql.jdbc.Driver"
        password="XXXXXXXXX"
        username="user"
        type="javax.sql.DataSource"
        factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
        testWhileIdle="true"
        testOnBorrow="true"
        testOnReturn="false"
        validationQuery="SELECT 1"
        validationInterval="30000"
        timeBetweenEvictionRunsMillis="30000"
        maxActive="10"
        minIdle="10"
        maxWait="10000"
        initialSize="10"
        removeAbandonedTimeout="60"
        removeAbandoned="true"
        logAbandoned="true"
        minEvictableIdleTimeMillis="30000"
        jmxEnabled="true"
/>



On Thu, Feb 15, 2018 at 6:03 AM, Mark Thomas 
<ma...@apache.org<mailto:ma...@apache.org>> wrote:
On 15/02/18 00:35, Halder, Arpan [ITSUS Non J&J] wrote:
> Hi All,
>
> Need urgent help. We are using apache tomcat version -7.0.67  and 
> sporadically facing issue that application become unresponsive and below 
> error message encountered in Catalina.out log:
>
> ExceptionCannot get a connection, pool error Timeout waiting for idle object
> Exception in detailorg.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get 
> a connection, pool error Timeout waiting for idle object
> within doFilter of Session Filter
> url :::::/SPECTRA/login
> Chain.doFilter()..
> Inside Login Method.........
>
> We had to restart tomcat service every time and issue gets resolved for the 
> time being and again reappears sporadically. Could you please advise if we 
> need to change any tomcat setting to mitigate this issue from happening in 
> future.
>
> Please let us know if you need anything else from my side in this regards. 
> Thank you in advance.

It sounds like you have a connection leak in your application. Enable
abandoned connection logging to find out where the leaked connections
are being created.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: 
users-unsubscr...@tomcat.apache.org<mailto:users-unsubscr...@tomcat.apache.org>
For additional commands, e-mail: 
users-h...@tomcat.apache.org<mailto:users-h...@tomcat.apache.org>



--
Peggy Bauer
CAO Production Support
214-770-1782

Reply via email to