This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

getting the active connections from connection pool  RSS feed

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends,
Is there a way to get the active connections from the connection Pool.
can i close the connection when using connection ppol. will the connection be automatically returned to connection pool.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

>> Is there a way to get the active connections from the connection Pool.
Did not get your question.
DataSource.getConnection always returns an active connection if you are using Connection Pooling.

You have to close the connection when using connection pool so that it is returned to the pool and can serve other components.
You can do it in finally block of the code.
 
sumitha sudhakar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I meant to ask for the no of active connections from the connection pool?
 
Goutham Pallipati
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per my knowledge there is no way to get the active connection count. It Internal to the container to judge on how many connections to keep. Still you can find the Maximum no. of connections allowed in the container setting. If there is a limit at database side on number of connections allowed you can tweak the connection pool settings to match it.

by the way why do you need that.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!