]
Yves Galante updated HHH-3221:
------------------------------
Attachment: SaveTest_v2.zip
Integrate this test on hibernate testsuite
Cascading performance problems when session contains many entities
------------------------------------------------------------------
Key: HHH-3221
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3221
Project: Hibernate Core
Issue Type: Patch
Components: core
Affects Versions: 3.2.5, 3.2.6, 3.3.0.CR1
Reporter: Yves Galante
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: