Hi,
I have the same trouble. I have looked into this and as I understand it has to do with the cascade values set in your hbm.xml files. When you set the value to 'all', Hibernate will save, update and delete all instances. But it seems that when you save a parent object, this cascades to updates to any children even though there are no changes made to the children.
This is causing problems for me because I have triggers on my database that record audit data of all insert, updates and deletes and when my parent object is saved the update trigger fires on all the children even though no updates were made.
I think the only way round this is to explicitly save your objects and set your cascades to 'none'.
I'm trying this now but can see its going to be problematic.
Is anyone else having this trouble ?
Am I right in my assumptions above?
Is there a way to stop my children getting updated when the parent is saved ?
Plese help the kids out !!
|