[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3860) Cascading performance problems when session contains many entities

Strong Liu (JIRA) noreply at atlassian.com
Wed Jul 7 09:07:13 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=37660#action_37660 ] 

Strong Liu commented on HHH-3860:
---------------------------------

https://jira.jboss.org/browse/JBPAPP-4562

> 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.3.x, 3.5.0-Beta-3
>
>         Attachments: patchCascading.patch, SaveTest.zip, SaveTest_v2.zip
>
>          Time Spent: 1.7h
>  Remaining Estimate: 0h
>
> 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