| This unexpected behavior of isDirty is due to the implementation of SessionImpl.isDirty, which may call DefaultDirtyCheckEventListener.onDirtyCheck, which does prepare the flush for detecting dirtyness (calling flushEverythingToExecutions from its base class AbstractFlushingEventListener. This flush preparation causes pending saves to be executed, triggering db-sided id generations by the way. In the case of an identity generator, this causes the whole entity insert. All that code is still doing that in current master. This has been duplicated by
HHH-6611 Closed closed by lack of test case.
HHH-3963 Closed was likely itself a duplicate of the poorly reported
HHH-404 Closed . A bunch of forum posts also exists on the subject, but none of these posts have a sound answer in my view. (1 (a bit light, without answer), 2 (more consistent, with an invalid suggestion as an answer which does not fix anything: using another flushmode like manual does not dodge the issue), 3, ...) I am concerned by the issue as a NHibernate developer. I was willing to check the state of this issue on Hibernate side. So unless I have missed some other tickets or forum post, it seems Hibernate is not ahead of NHibernate on this subject currently. (Latest issue #1413.) |