Announcement Announcement Module
Collapse
No announcement yet.
Connection pooling -response Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Connection pooling -response

    Hi

    My config file is as follows..

    <beans>



    <bean id="datasource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" >

    <property name="driverClass" value="com.ibm.db2.jcc.DB2Driver"/>

    <property name="jdbcUrl" value="jdbc:db2://ipaddress/instance_name"/>

    <property name="user" value="xxx"/>

    <property name="password" value="xxx"/>

    <property name="minPoolSize" value="15"/>

    <property name="maxPoolSize" value="200"/>

    </bean>



    <bean id="AccessDAO" class="com.db.AccessDAO">

    <property name="dataSource"><ref bean="datasource"/></property>

    </bean>


    *************************
    And my class...

    publc class AccessDAO extends JdbcDaoSupport{

    public int getValueoOfCust(){

    getJdbctemplate().query(..);
    retunr intvalue;

    }

    }
    *****************

    When the first request comes..in it takes a great deal of time for connecting to the database...order of 4000ms

    whereas for the following requests..it gives a fast reponse..order of 600ms

    I want that connection pool be ready at appln startup...and all the requests including the first one takes the same amt of time as the following requests..

    Regards

  • #2
    Hi,

    you could try to set the initialPoolSize property to the same value as the minPoolSize.

    rgds
    agim

    Comment


    • #3
      There's an example here.
      http://forum.springframework.org/showthread.php?t=33166
      Last edited by karldmoore; Aug 27th, 2007, 02:35 PM.

      Comment


      • #4
        Hi,

        I have modified the configuration...

        Code:
        <bean id="datasource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" >
        
        <property name="driverClass" value="com.ibm.db2.jcc.DB2Driver"/>
        
        <property name="jdbcUrl" value="jdbc:db2://ipaddress/instance_name"/>
        
        <property name="user" value="xxx"/>
        
        <property name="password" value="xxx"/>
        
         <property name="initialPoolSize" value="15"/>
        
        <property name="minPoolSize" value="15"/>
        
        <property name="maxPoolSize" value="200"/>
        
        </bean>
        But still it gets initialized when the first request comes in...
        and the first request takes a good deal of time...

        Whats wrong with the configuration??

        Comment


        • #5
          Is there any other configuration thats need to be done for it to be
          done at startup.....???

          Comment

          Working...
          X