In my web application (a Servlet) I create and use an EntityManagerFactory and then shut it down with the close() method in my servlet destroy() method. However, when I shut down my web application MySQL admin console shows me that there is still an open connection to the database. I can see the hibernate log statement saying it has closed, but the connection remains.
I'm using Tomcat and have my DataSource configured in a context.xml file like this;
<Context> <Resource name="jdbc/myDataSource" auth="Container" type="javax.sql.DataSource" maxActive="20" maxIdle="10" maxWait="3000" username="testuser" password="xxxxx" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/myschema" defaultAutoCommit="false"/> </Context>
Any suggestions as to why the connection isn't being closed?
|