-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: EntityManagerFactory leaves DB connections open
PostPosted: Tue Mar 23, 2010 8:12 am 
Newbie

Joined: Tue Mar 23, 2010 7:55 am
Posts: 1
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.