This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Glassfish Connection Pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Glassfish Connection Pooling" Watch "Glassfish Connection Pooling" New topic
Author

Glassfish Connection Pooling

Wesley Baker
Ranch Hand

Joined: Aug 20, 2008
Posts: 45
I am getting an odd error that gets logged every time a certain criteria is met, and I'm not sure what the criteria is and how to stop it. I have to restart Glassfish everytime it happens:



ArtivaProd is the name of the JDBC Connection Pool in Glassfish.

I would blame my code for something like this normally, but the only pooled database connection is being used by the Form Authentication process in Glassfish for login.

I guess my question is, why are the connections not being released/renewed?

I'll be happy to post my configuration, just let me know which parts you want to see.
Vinod K Singh
Ranch Hand

Joined: Sep 30, 2008
Posts: 198
As the exception clearly says "Unable to get a connection: max pool size exceeded". So this is not a configuration issue but it is related to freeing up resources in the code.


My Blog
Wesley Baker
Ranch Hand

Joined: Aug 20, 2008
Posts: 45
Right, but what I meant to say was that there is no code. This is happening from the Form Authentication in Glassfish. The one where you set up automated security checks with the JDBC Realm Authentication using j_security_check
Vinod K Singh
Ranch Hand

Joined: Sep 30, 2008
Posts: 198
I see two reasons for the exception-
1. Glassfish authentication code is leaking the connection or
2. The max connection limit of pool is too low, leading to hitting the upper limit when many users try to login at the same time.
Wesley Baker
Ranch Hand

Joined: Aug 20, 2008
Posts: 45

1. Glassfish authentication code is leaking the connection


I don't think this is the problem, or else a Google search would show a lot more instances of it than just me. I will check their bug list, though.


2. The max connection limit of pool is too low, leading to hitting the upper limit when many users try to login at the same time.


This could be a possibility. I will try increasing the number and see if that helps.
TestConfig testConfig
Greenhorn

Joined: Feb 16, 2012
Posts: 3
Hi All,

I know this thread is old one, I was also getting the
"The max connection limit of pool is too low...". The solution which worked for me was closing
Statements, ResultSet and Connection objects, in the finally block.


Hope this helps some one.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Glassfish Connection Pooling
 
Similar Threads
JBOSS JMS thread monitor
Connection not getting closed in websphere
Unable to find database
Glassfish error
Connecting to oracle through glassfish