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 220.127.116.11.
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 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:
Joined: Oct 02, 2011
I'm sorry it's my mistake. I forgot to close the some entity managers in my code.