[hibernate-dev] Comment patch - cascading performance

Yves Galante yyvess at gmail.com
Thu Oct 22 16:11:50 EDT 2009


Hi,

Could someone look at HHH-3860 and comment on the patch attached in
JIRA. It a update from an old patch "HHH-2272  Serious performance
problems when saving large amount".

This patch optimize cascading operation by the caching the relation
parent-child on a temporary map.
When a child find its parent, he lookup on his map, at the end of the
cascading  operation, the map is empty.
Actually his parent it fined by parsing all entity of the session.

eventSource.getPersistenceContext().addChildParent(child, parent);
action.cascade(eventSource, child, entityName, anything,
isCascadeDeleteEnabled);
eventSource.getPersistenceContext().removeChildParent(child);

Cascade 5510 objects took 30906 ms on my test before this patch.
With the patch the test case took 4905 ms.


Thanks

Yves



More information about the hibernate-dev mailing list