I have an application running under wildfly 8.1 The database connections used in the applications are taken from a Datasource defined in standalone.xml file.
Proble
It turns out that Hibernate was holding connection and not releasing them to the Pool. Irrespective of the fact that we are using thread local context. But after adding <property name="hibernate.connection.release_mode">after_transaction</property>
to the hibernate config. The problem got solved.
PS: I still dont understand why we need to define this explicitly and why the auto release_mode would not release the connection once the session is closed.