This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Control the Connections in the Connection Pool? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Control the Connections in the Connection Pool?" Watch "Control the Connections in the Connection Pool?" New topic
Author

Control the Connections in the Connection Pool?

Namitha karupaiya
Ranch Hand

Joined: Mar 10, 2004
Posts: 89
I have developed an application using MySQL & JDBC and get the following error message time to time:

“In use connection equals maximum pool size… Cannot allocate more connections…”

I guess that my application has opened database connections but unable to close them because some exceptions may have occurred in the mid.

If I use JPA & EJB will the server take the responsibility to manage the connection pool automatically?

Thank you.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3817

Namitha karupaiya wrote:I have developed an application using MySQL & JDBC and get the following error message time to time:
“In use connection equals maximum pool size… Cannot allocate more connections…”
I guess that my application has opened database connections but unable to close them because some exceptions may have occurred in the mid.

You are not closing the connections in either catch or finally block in your code?

SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Control the Connections in the Connection Pool?
 
Similar Threads
Connection Pooling Help Needed
Simple Que Abt Connection Pool
Store Connection Pool
How do the connections get closed in Connection Pool
Variables scope