• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connection pooling

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

Hope all are doing great !

I have one doubt in connection pooling,Like i created a connection poling with 25 connections.all are being engaged with 25 users,now what happens when 26 users wants to the connection..?

2.What is the default connections number in connection pooling..?

KIM.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Like i created a connection poling with 25 connections.all are being engaged with 25 users,now what happens when 26 users wants to the connection.?


That depends on the pool implementation. It might throw an exception, or it might wait until another thread hands back a connection to the pool, and then allow the code to continue.

2.What is the default connections number in connection pooling.?


Each implementation has a different default, but just about all of them allow that number to be configured, so the default doesn't mean much. You should change it to something that suits your need anyway.
 
Author
Posts: 531
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you explain more about your application and How do you find out that all 25 connections are in use?

Usually we keep the connection pool size to let usual number of concurrent operation get a connection without waiting for a connection to be released.

when all 25 connections are in use your database operation should wait until a connection get returned to the pool, then the datasource will pick this connection and return it to your application in order to continue the pending operation.

In case that no connection get returned to the pool after some specific time which you determined in the connection pool preference, your datasource.getConnection will return an exception and your client thread future will depend on how you handle the exception.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic