• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Connection Pooling Doubt

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I don't know whether this is right place to post this question or not.

I am using connection pooling in Tomcat6.0.18, i am using <resource> element to configure for connection pooling and its working fine.

My doubt is, is there any configuration can be done, for increasing the number of connection dynamically in the Pool.

For example, if the available connection is 10 and all the 10 available connections are busy, can i configure to increase the pool size by 10 each time when all the connections are busy. At the same time the number of connections is not used means it should reduce to the minimum number of connection in the pool.

I don't know whether this facility is available in Connection pooling or not. Please solve my problem.

Thanks In Advance.

Bennet Xavier. X

 
Saloon Keeper
Posts: 24293
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This would depend on which connection pooler you use. If my memory isn't too far off, the Apache DBCP pooler, which is the one that's shipped with Tomcat has a set of parameters that determine baseline and max connection counts. Connects are acquired on demand, not in batches, since while getting a connection is fairly expensive, there's no benefit in attempting to acquire more than one at a time. That is, if you ask for 8 connections at once, it will take 8 times as long as it does to open just one connection.

For a complete rundown on the options for DBCP, check the Tomcat docs on connection pools and the apache commons docs on Apache DBCP itself.

If you REALLY wanted to, you could create a custom connection pooler, but I don't advise doing this kind of stuff lightly. It can adversely impact every app in your Tomcat server if you don't get everything meticulously correct.
 
Bennet Xavier
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim Holloway,

Thank you for your reply...

I think you didn't understand my question, my problem is, I need to configure the web-application so that the connection in the pool must increment if there is no connection available for the coming request.

Example. this is rough example dont consider this in real suitation.

assume the connection is not closed in a method, then after some time the request will not be responded, since there is no connection available in pool. at this point of time is it possible to increase the pool size by say 10 connection.

Like the StringBuffer which increments it size if the string size increases...

Thanks and Rregards
Bennet Xavier. X
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic