I use NHibernate for my dataacess, and for awhile not I\'ve been using SQLite for local integration tests. I\'ve been using a file, but I thought I would out the :memory: o
I had similar problems that lasted even after opening the ISession as stated above, and adding "Pooling=True;Max Pool Size=1" to my connection string. It helped, but I still had some cases where the connection would close during a test (usually right after committing a transaction).
What finally worked for me was setting the property "connection.release_mode" to "on_close" in my SessionFactory configuration.
My configuration in the app.config file now look likes this:
testSqlLiteDB
NHibernate.Driver.SQLite20Driver
NHibernate.Connection.DriverConnectionProvider
on_close
NHibernate.Dialect.SQLiteDialect
NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle
true=1;false=0
Hope it helps!