Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Deniz Gol
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3398
13
Android Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Deniz Gol
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry it's my mistake. I forgot to close the some entity managers in my code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic