aspose file tools*
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 Spring in Action this week in the Spring 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: 3838

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?