c3p0 maxIdleTime not working

502 просмотра

1 ответ

4725 Репутация автора

I have a java spring hibernation application with postgresql. this is my C3p0 settings

    <property name="acquireIncrement" value="5"/>
    <property name="initialPoolSize" value="5"/>
    <property name="minPoolSize" value="5" />
    <property name="maxPoolSize" value="${c3p0.maxPoolSize}" />

    <property name="maxIdleTime" value="1800"/>
    <property name="numHelperThreads" value="6"/>
    <property name="maxStatements" value="0" />
    <property name="maxStatementsPerConnection" value="20" />

    <property name="idleConnectionTestPeriod" value="3000" />

In Pgadmin, I am seeing connections that are sitting idle for more than 2 hours. Is there any other property that needs to be set

Автор: user373201 Источник Размещён: 18.07.2016 03:10

Ответы (1)


0 плюса

3774 Репутация автора

The maxIdleTime setting is for connections that are idle in the pool. Which means not checked-out. Is it possible that you have some connections that are not closed? In that case connections will be open and not considered as idle because they are checked-out but not checked-in. For such a case you can set unreturnedConnectionTimeout and debugUnreturnedConnectionStackTraces to find where this unclosed connection is.

http://www.mchange.com/projects/c3p0/#unreturnedConnectionTimeout

http://www.mchange.com/projects/c3p0/#debugUnreturnedConnectionStackTraces

Автор: alpert Размещён: 17.08.2016 02:46
Вопросы из категории :
32x32