[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-3860) Cascading performance problems when session contains many entities
Steve Ebersole (JIRA)
noreply at atlassian.com
Mon Nov 30 11:15:09 EST 2009
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3860?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steve Ebersole updated HHH-3860:
--------------------------------
Assignee: Steve Ebersole
Fix Version/s: 3.5
Component/s: core
Issue Type: Patch (was: Improvement)
Perhaps apply to 3.3 as well; need to look at the impact.
> Cascading performance problems when session contains many entities
> ------------------------------------------------------------------
>
> Key: HHH-3860
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3860
> Project: Hibernate Core
> Issue Type: Patch
> Components: core
> Affects Versions: 3.3.1, 3.3.2
> Reporter: Yves Galante
> Assignee: Steve Ebersole
> Fix For: 3.5
>
> Attachments: patchCascading.patch, SaveTest.zip, SaveTest_v2.zip
>
>
> When session contains many entities, performence of cascading become very slow.
> For each collection element the whole persistence context is searched (by StatefulPersistenceContext#getIndexInOwner() and StatefulPersistenceContext#getOwnerId) and its even searched twice when the collection is an indexed collection.
> This patch optimize cascading operation by caching relation parent-child on a map.
> eventSource.getPersistenceContext().addChildParent(child, parent);
> action.cascade(eventSource, child, entityName, anything, isCascadeDeleteEnabled);
> eventSource.getPersistenceContext().removeChildParent(child);
> The test case save and flush 10 * 551 objects.
> Before patch save object with cascading is more slow when session size grows.
> After patch time of save stay same at each loop.
> Output of the test case before the patch :
> Save took 449 ms
> Save took 669 ms
> Save took 1042 ms
> Save took 1464 ms
> Save took 2481 ms
> Save took 2741 ms
> Save took 3807 ms
> Save took 4344 ms
> Save took 4975 ms
> Save took 5251 ms
> Total took 30906 ms
> Output after the patch
> Save took 445 ms
> Save took 144 ms
> Save took 164 ms
> Save took 108 ms
> Save took 93 ms
> Save took 93 ms
> Save took 93 ms
> Save took 94 ms
> Save took 91 ms
> Save took 89 ms
> Total took 4905 ms
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list