Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection pooling

 
Mortin kim
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • 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.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • 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.
 
Masoud Kalali
Author
Ranch Hand
Posts: 531
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic