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: option. When I fire up any of the integration tests, the database seems to be created (NHibernate spits out the table creation sql) but interfacting with the database causes an error.
Has anyone every gotten NHibernate working with an in memory database? Is it even possible? The connection string I'm using is this:
Data Source=:memory:;Version=3;New=True
I hade alot off problems with SQLite memory database. So now we are using SQLite working with files on a ramdrive disk.
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:
Hope it helps!