You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

NHibernateProjectRepository creates and manages NHibernate SessionFactory objects. A SessionFactory object has a Dispose method that must be called to clean up resources. Otherwise, the SessionFactory objects will remain in memory and will not be garbage collected.

NHibernateProjectRepository, IProjectRepository and (I)ProjectService all have a Dispose method, to make sure all resources are cleaened up.

If you use NHibernateProjectRepository or ProjectService in your tests, always call the Dispose method when you're finished! Otherwise, you will get memory leaks and possibly other tests failing because of out of memory errors!

 

  • No labels