This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

commons DBCP problem

 
Shankar Narayana
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The commons DBCP doesn't work properly, the connection reuse is never done, i was trying the application with DBCP with initial connections set at 25 and when i hit the page 26th time, the page never shows up, the error cannot retrieve connection from the pool. Although my application always closes the connection after using it. I have seen a lot of people complaining about this, don't know whether they have found the solutions for it or not.

I am now using the PoolMan which is based on JDBC 2.0 and which lacks some of the methods like returning the Generated keys for which i had to synchronize the objects to get the functionality. Except this, poolman is very efficient in reusing the connections.

If anyone is using the Commons DBCP haven't you got this problem anytime, if so how to solve?.
 
Chris Stehno
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first question that comes into my head is 'are you returning the connections to the pool?' I have used DBCP in numerous problems and have found it to be quite stable and reliable. There are manu configuration settings, though. You may want to take a closer look at the documentation and at how your app is using and returning connections.

Hope this helps.
 
Shankar Narayana
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I am returning the connections, the code i write is like this.


am I doing anything wrong here.. else if u can post your code of how you are using the connections and returning them, it would be a gr8 help.

Thanks
Shankar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic