I am trying to import some large files using batch requests and parallel processing, and I constantly get errors like
NHibernate.HibernateException: identifier of an instance of xxx was altered from ... to ...
I know that I do not change my primary key at all. I use NH 2.1.x GA, ThreadStaticSessionContext, each file is processed in a separate thread (using ThreadPool), and the information in the files is uncorrelated. I have a session and transaction for each file, but I do not clear the session at all. In the same thread, I commit a transaction and close the session, but this error creeps me.
If you have any suggestions ...
source share