We are using Nhibernate to connect to a local firebird database file. We currently load it embedded but in some occasions need to release it so the file on disk can be moved or deleted. Simply closing and disposing the sessionfactory in nhibernate does not work. The file is still in use.
using (ISessionFactory sessionFactory = configuration.BuildSessionFactory())
{
using (ISession session = sessionFactory.OpenSession())
{
using (System.Data.IDbCommand command = session.Connection.CreateCommand())
{
// commands removed
}
}
sessionFactory.Close();
}
// file is still "in use" here
Is this possible to do or do we need to start a separate process?