Announcement Announcement Module
Collapse
No announcement yet.
problem with maxPoolSize and losing connection Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • problem with maxPoolSize and losing connection

    hi evry body...

    When active connection counts on db reach to "maxPoolSize" connection to db gets lost but there is no exception. It seems it sleeps and stay in waiting mode. and when I check SQL server all the connections are in sleeping status. Even when I try to commit the kill process nothing would happen.
    what can I do? plz help me..
    P.S
    I use
    spring 2.0.3
    hibernate 3.3.1
    c3p0 0.9.1

    and my configuration is:
    Code:
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
            <property name="driverClass" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
            <property name="jdbcUrl" value="jdbc:sqlserver://127.0.0.1:1433;databaseName=MyDB"/>
            <property name="user" value="user"/>
            <property name="password" value=""/>
            <property name="initialPoolSize">
                <value>10</value>
            </property>
            <property name="minPoolSize">
                <value>1</value>
            </property>
            <property name="maxPoolSize">
                <value>300</value>
            </property>
            <property name="acquireRetryAttempts">
                <value>10</value>
            </property>
            <property name="acquireIncrement">
                <value>5</value>
            </property>
            <property name="idleConnectionTestPeriod">
                <value>3600</value>
            </property>
            <property name="maxIdleTime">
                <value>10800</value>
            </property>
            <property name="maxConnectionAge">
                <value>14400</value>
            </property>
            <property name="preferredTestQuery">
                <value>select 1</value>
            </property>
            <property name="testConnectionOnCheckin">
                <value>false</value>
            </property>
        </bean>
    Last edited by Ardeshir; Jul 19th, 2009, 04:40 AM.

  • #2
    If you use hibernate and c3p0 there are issues with hibernate overwriting c3p0's settings.

    There is a great deal of misunderstanding around this issue, to the point that when someone who knows the answer writes a solution it is so vague that it is almost useless.
    You will just have to trawl the forums looking for clues (like what I'm doing) because the documentation is vague and misleading.

    Comment

    Working...
    X