Cascading is done during Session.Save and Commit even though cascade attribute is not set. #2781
Replies: 2 comments 4 replies
-
Where exactly are you looking? Did you check the actual cascading code - all checks are there: nhibernate-core/src/NHibernate/Engine/Cascade.cs Lines 107 to 126 in 6ab71d0 So if those |
Beta Was this translation helpful? Give feedback.
-
It looks like you need some custom flushing logic. You can implement it in your own custom class implementing //Somewhere before session factory is created:
configuration.EventListeners.FlushEventListeners = new[]{ new YourCustomFlushEventListener()}; Or in xml: <hibernate-configuration>
<session-factory>
...
<event type="flush">
<listener class="YourCustomFlushEventListener"/>
</event>
</session-factory>
</hibernate-configuration> |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi There,
In our application when I am trying to save the new created object, there is cascading happening before and after saving to the properties of the object which are of collection type and entity type. I have not specified cascade attribute in my HBM. When I look at the code for Session.Save, there is mandatory cascading happening. This is causing performance bottlenecks when I call Session.Save. Is there any way we can avoid this code block, as the relationship and order in which objects are added is handled by application itself.
Please reply ASAP as we have lot of performance bottlenecks coming due to this
Beta Was this translation helpful? Give feedback.
All reactions