Hi all,
I have a set of nunit-based integration/persistence tests that roughly go as follows:
SetUp Delete the existing database, create a new database, load NHibernate configuration, SchemaExport.Create(). This is done by our application object, which means that a SessionFactory is created as well even though I don't really use it in this step.
Test Put some data in the database, close the app (and nhibernate), open a new instance of the app, load data, compare data.
For each test, the first step is repeated. However, after the first test, the setup fails because the database is still in use and cannot be dropped. The SessionFactory seems to open a connection on creation and does not close this anymore, even SessionFactory.Close() and Dispose() do not close the connection.
Any pointers on how I can close this lingering connection?
Thanks, Bert.
|