How to get more info on NHibernate's Illegal attempt to associate a collection with two open sessions

630 views Asked by At

Our project has been using NHibernate with success for quite some time. However, in the last months of new development we managed to make a change that gives us lots of:

NHibernate.HibernateException: Illegal attempt to associate a collection with two open sessions

This shows up on our test server. It does not/hardly happen on our development systems.

Question: Is there a way to find some more info about this exception. It would help if we knew e.g. which Collection is giving the problem.

We tried NHibernate Profiler but that does not give that type of information.

Thanks, Willem

1

There are 1 answers

1
Diego Mijelshon On

NHibernate uses (by default) log4net for logging.

You can configure it, set the DEBUG level for the root logger, and you'll get all the possible information about the inner workings of NHibernate related to the error.

Of course, you can also get a stack trace of your own code, figure which calls are causing the exception, and post them here.