This is almost certainly because of connections not being disposed of properly (https://stackoverflow.com/a/5442062/221708), which in your case may be caused by not disposing of NHibernate sessions properly. Just like you should wrap connections in using
blocks, you should wrap NHibernate sessions in using
blocks.
Here are a couple of good articles on managing NHibernate sessions in WCF:
- NHibernate SessionPerRequest with WcfOperationSessionContext
- NHibernate session management and WCF, redux
Also remember that if you are using the sessionFactory.OpenSession(IDbConnection)
overload, you are responsible for closing the connection returned by session.Close()
.