I'm wondering if someone can help me understand why I'm getting a No Managed Connections available error. I've done a lot of searching and I am struggling to understand why this happens. Everyone says to make sure that you close the sessions in a finally block.
The thing is I'm using JBoss 4.0.2 with Hibernate 3.0.5 with a session bean accessing a postgres and ingres database. I NEVER call openSession only getCurrentSession but after a while (two days in the last instance) I get the above mentioned error.
I've used the JMX console to inspect the pools and it says that there are 0 connections available out of the maximum 20 (defaults). It is my understanding that JBoss handles the closing of all connection for you when using getCurrentSession.
So why am I running out of connections?
Thanks for any input!
If you are opening a session and then getting hold of the associated connection by calling session.connection() then it is your responsibility to close it.