I figured a different behaviour in Envers 5.0 compared to previous versions. It is related to the 2 settings 'RevisionOnCollectionChange' and 'GlobalWithModifiedFlag'. If both settings are set to true and the reference of one entity is changed, it ends up in an exception:
NHibernate.LazyInitializationException : Initializing[Envers5Bug.Person#1]-failed to lazily initialize a collection of role: Envers5Bug.Person.Cars, no session or session was closed
Since it is much harder to describe I prepared a very simple project which is revealing the problem. Please run Program.cs or Test.cs.
Locally I created a branch with test, showing the problem. Unfortunately I cannot push the branch to the repository:
hg push --new-branch default
pushing to https://firstname.lastname@example.org/RogerKratz/nhibernate.envers
searching for changes
abort: authorization failed
The authentication dialog of SourceTree it says that I entered the right credentials. Do I need special rights from your side? Sorry, I never used BitBucket before.
I would guess it is a like GitHub: you should not push directly to Envers repository, but to your own clone of the repository, then issue a PR from it toward Envers repository.
Yes, exactly. Thanks for pointing that out, Frederic.
Thanks, finally I managed to create a pull request
Thanks for fixing this bug so fast.