Hi! I figured this was the better list...

Although it's a bit frowned upon, I'm using a custom eventlistener (
http://fabiomaulo.blogspot.com/2009/03/ensuring-updates-on-flush.html) to
require explicit saving of entities. Is has worked really well, until
yesterday when we updated to NHibernate 3 (3.1.0.4000). What we found was
that NH now performs cascading actions on entities, even if their status is
ReadOnly. It seems unnecessary and it breaks our implementation of
NHibernate Validator. Checking the source made it very clear.

AbstractFlushingEventListener->PrepareEntityFlushes in 2.1:

if (status == Status.Loaded || status == Status.Saving)
{
CascadeOnFlush(session, entry.Persister, me.Key, Anything);
}

AbstractFlushingEventListener->PrepareEntityFlushes in 3.1:

if (status == Status.Loaded || status == Status.Saving* || status ==
Status.ReadOnly*)
{
CascadeOnFlush(session, entry.Persister, me.Key, Anything);
}

The change came from a merge with the ReadOnlyEntitites branch (NH-908)

What's up with that? Should it really do that?

/G

Reply via email to