I'm not sure, but perhaps the question of Gunnar is: Why a read-only instance should run cascades during flush ?
On Fri, May 20, 2011 at 7:12 AM, Julian Maughan <[email protected]>wrote: > Just read Fabio's blog that you referred to. Its an interesting usage of > NHibernate that I haven't seen before. > > 'Read-only entities' is a feature ported faithfully from Hibernate. The > Hibernate documentation describes (in detail) the way read-only entities > behave with respect to associations (see > http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/readonly.html). > If you read this it should clarify *why* the cascade is necessary...but > basically it is. > > I'm not familiar with NHibernate Validator, but can you explain why it is > broken by the change? Presumably your entities' children are being validated > when you don't want them to be? Do your association mappings have cascading > enabled explicitly, e.g. cascade="all"? Have you tried cascade="none", and > then doing the cascade in the PreUpdateEventListener (like Fabio does in his > blog post)? > -- Fabio Maulo
