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.  [ 3 posts ] 
Author Message
 Post subject: Connection isn't closing
PostPosted: Mon Jan 29, 2007 2:17 pm 
Beginner
Beginner

Joined: Thu Oct 19, 2006 1:03 pm
Posts: 29
I'm having a problem with NHibernate not closing its database connections, and I really can't get why it's doing what it is.

When I use the following code, the quickstarts session manager or another session manager together with a httpmodule with EndRequest { ... session.Close() ... } in it, the database just seems to keep the connection open, if I open up MySQL Administrator.

If I use the MySqlConnection object or its signature from the interfaces, I don't have the same problem. So how do I get the *** connection to close itself? (help!)

Hibernate version:
1.2 Beta 3

Mapping documents:
Any.

Code between sessionFactory.openSession() and session.close():
Code:
using (ISession session = sessionFactory.OpenSession())
{
   ITransaction tx = session.BeginTransaction();
   Customer c = new Customer();
   c.Name = "Kalle";

   session.Save(c);

   c = new Customer();
   c.Name = "Karl";
   session.Save(c);

   lblResponse.Text = "Data inserted.";
   tx.Commit();
} //Dispose() is called here.


Full stack trace of any exception that occurs:
No exception.

Name and version of the database you are using:
MySQL 5.0.27-community-log

Test-case: http://files-upload.com/files/81447/NHi ... n.rar.html


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 29, 2007 6:40 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
This may be connection pooling at work.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 30, 2007 2:09 am 
Beginner
Beginner

Joined: Thu Oct 19, 2006 1:03 pm
Posts: 29
sergey wrote:
This may be connection pooling at work.


Hi,
I don't think so, because if you view the MySQL administrator -> Health -> Status Variables -> Networking, you see that Aborted_clients increases as the waiting connections time out.

It also seems that when more clients hit the web site, more connections are used; one per client, that then time out.

//Edit: Could someone download the project and see if they get the same result?
Here's the administrator: http://www.mysql.com/products/tools/administrator/

and the database:
http://dev.mysql.com/downloads/mysql/5.0.html#downloads


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

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.