aspose file tools*
The moose likes Glassfish and the fly likes JDBC Connection Pool's number of used connection is increasing continuous Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Glassfish
Bookmark "JDBC Connection Pool Watch "JDBC Connection Pool New topic
Author

JDBC Connection Pool's number of used connection is increasing continuous

Deniz Gol
Greenhorn

Joined: Oct 02, 2011
Posts: 6
Hello, i wrote a jsf web application. I'm using jsf 2.1.9, hibernate jpa 4.1.4, mysql server 5.6.13 and glassfish server 3.1.2.2.
My problem is; number of used connections increasing continuous and when it reaches the max pool size, it gives this error:

i also opened jdbc monitoring from glassfish server and currently used connection number is 350 but nobody using application. How can i terminate this connections and where should i do this ? with glassfish or mysql configuration or from my code ? I need advice and some information about this subject. I'm just creating entity transactions and closing it when it's done in my code.
I can provide more infromation if you need, thanks for your helps.
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2419
    
    7

Not sure if this may be an issue. Is the mysql available connections > the max pool size you configured in glassfish?

If it is once glassfish is started and kicked in (allotted the pool size), no more new connections can be made.

Another thing to check is did you manually close all database connections after each transaction?


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
Deniz Gol
Greenhorn

Joined: Oct 02, 2011
Posts: 6
K. Tsang wrote:Not sure if this may be an issue. Is the mysql available connections > the max pool size you configured in glassfish?

If it is once glassfish is started and kicked in (allotted the pool size), no more new connections can be made.

Another thing to check is did you manually close all database connections after each transaction?


no there is only 15 connections i can see from mysql workbench but numconnused value on glassfish monitor is 351. i set max pool size to higher value before. but number of used connections will reach the limit with time like as before.

And i never close manually database connections, i'm only closing entitty transactions like that:

Deniz Gol
Greenhorn

Joined: Oct 02, 2011
Posts: 6
I'm sorry it's my mistake. I forgot to close the some entity managers in my code.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC Connection Pool's number of used connection is increasing continuous