Results 1 to 5 of 5

Thread: Connection pooling -response

  1. #1
    Join Date
    Mar 2005
    Location
    India
    Posts
    97

    Default 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. #2
    Join Date
    Nov 2006
    Location
    Germany
    Posts
    452

    Default

    Hi,

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

    rgds
    agim

  3. #3
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,425

    Default

    Last edited by karldmoore; Aug 27th, 2007 at 02:35 PM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

  4. #4
    Join Date
    Mar 2005
    Location
    India
    Posts
    97

    Default

    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??

  5. #5
    Join Date
    Mar 2005
    Location
    India
    Posts
    97

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •