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