No of Connection keep increasing

202 views
Skip to first unread message

arun kumar

unread,
Dec 26, 2018, 7:17:10 AM12/26/18
to HikariCP
Hikari config 
        config.setDriverClassName(DriverClassName);
        config.setJdbcUrl(URL);
        config.setUsername(username);
        config.setPassword(password);
        config.addDataSourceProperty("cachePrepStmts", "true");
        config.addDataSourceProperty("prepStmtCacheSize", "250");
        config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
        config.setPoolName("insurance");
        config.setRegisterMbeans(true);
        config.setConnectionTimeout(10000);   
        config.setMaxLifetime(100000);           
        config.setIdleTimeout(70000);  

Coding

            con = HikariCPConnectionInsur.getConnection();
            stmt = con.prepareStatement(Qry);
            rs = stmt.executeQuery();

After each transaction connection closed properly.

        finally {
            DbUtils.closeQuietly(rs);
            DbUtils.closeQuietly(stmt);
            DbUtils.closeQuietly(con);
        }


At one item I am using only one active connection. But no of connections increasing. What is the reason ?
Systemname                                     No of connections

visvaedp47        JDBC Thin Client     144
arunkumar  JDBC Thin Client       52
              
Any inputs will be appreciated .





Brett Wooldridge

unread,
Dec 29, 2018, 2:05:26 AM12/29/18
to HikariCP
I suggest that you enable leak detection and check the logs. Also make sure you are not creating and destroying (or discarding) multiple pool instances — I have seen that mistake a lot.
Reply all
Reply to author
Forward
0 new messages