Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Connection Pooling all connections in pool are over then? what next?

 
Anurag Pathak
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using InitialContext Java API and have a pool of 50 Connections.
Now a scenario is there wherein all 50 connections are used and I have 20 new Connection Request assuming maxIdle and MaxWait are set to zero.
In this scenario what will happen whether these 20 users will have to wait or I have to create a new pool.
Please let me know the standard way around what is followed in Standard Java Coding.
Awaiting Response.

Regards

Anurag
 
J. Kevin Robbins
Bartender
Pie
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to JDBC forum.
 
Dave Tolls
Ranch Hand
Posts: 2102
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anurag Pathak wrote:Hi,

I am using InitialContext Java API and have a pool of 50 Connections.
Now a scenario is there wherein all 50 connections are used and I have 20 new Connection Request assuming maxIdle and MaxWait are set to zero.
In this scenario what will happen whether these 20 users will have to wait or I have to create a new pool.
Please let me know the standard way around what is followed in Standard Java Coding.
Awaiting Response.

Regards

Anurag


With a zero maxWait I would hazard a guess that you'll get a timeout exception for those 20 users.

Why use a zero maxWait?
 
J. Kevin Robbins
Bartender
Pie
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you closing the connections within a finally block as soon as you are done processing the result set?
 
Joe Ess
Bartender
Posts: 9339
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using InitialContext Java API


InitialContext is part of the javax.naming API and has nothing to do with connection pooling. I would expect this behavior to be implementation-specific. What connection pool are you using?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic