I have made some more checks. It seams that the slow part i was thinking about is not the problem.
As well the problem of Dropping All and Adding each again was solved by the Set.
However the biggest issue is that hibernate is doing a LOT of selected before droping the Group all the testcases belong to:
Code:
tcm.deleteTestGroup(tgrp.getId())
As we have this tree: TGrp 1:n TCase 1:n TCaseRevision n:m TTarget
it is doing this.. before dropping the grp:
Code:
127.0.0.1]",37,0,"Query","/* */ select revisionli0_.testCase_id as testCase10_2_, revisionli0_.id as id2_, revisionli0_.id as id37_1_, revisionli0_.author_login as author9_37_1_, revisionli0_.comment as comment37_1_, revisionli0_.createDate as createDate37_1_, revisionli0_.revision as revision37_1_, revisionli0_.visibility as visibility37_1_, revisionli0_.description as descript6_37_1_, revisionli0_.executionNumber as executio7_37_1_, revisionli0_.name as name37_1_, revisionli0_.testCase_id as testCase10_37_1_, user1_.login as login31_0_, user1_.email as email31_0_, user1_.fistName as fistName31_0_, user1_.lastName as lastName31_0_, user1_.password as password31_0_ from qs_revision_TestCase revisionli0_ left outer join qs_User user1_ on revisionli0_.author_login=user1_.login where revisionli0_.testCase_id=125 order by revisionli0_.revision DESC"
"2008-05-06 14:34:16","qsadmin[qsadmin] @ localhost [127.0.0.1]",37,0,"Query","/* */ select targetlist0_.testCaseRevisionList_id as testCase2_1_, targetlist0_.targetList_target as targetList1_1_, testtarget1_.target as target27_0_, testtarget1_.description as descript2_27_0_, testtarget1_.name as name27_0_ from qs_mapping_TestTarget targetlist0_ left outer join qs_TestTarget testtarget1_ on targetlist0_.targetList_target=testtarget1_.target where targetlist0_.testCaseRevisionList_id=248"
"2008-05-06 14:34:16","qsadmin[qsadmin] @ localhost [127.0.0.1]",37,0,"Query","/* */ select targetlist0_.testCaseRevisionList_id as testCase2_1_, targetlist0_.targetList_target as targetList1_1_, testtarget1_.target as target27_0_, testtarget1_.description as descript2_27_0_, testtarget1_.name as name27_0_ from qs_mapping_TestTarget targetlist0_ left outer join qs_TestTarget testtarget1_ on targetlist0_.targetList_target=testtarget1_.target where targetlist0_.testCaseRevisionList_id=247"
"2008-05-06 14:34:16","qsadmin[qsadmin] @ localhost [127.0.0.1]",37,0,"Query","/* */ select instructio0_.testCase_id as testCase2_1_, instructio0_.id as id1_, instructio0_.id as id29_0_, instructio0_.testCase_id as testCase2_29_0_ from qs_TestInstruction instructio0_ where instructio0_.testCase_id=126"
"2008-05-06 14:34:16","qsadmin[qsadmin] @ localhost [127.0.0.1]",37,0,"Query","/* */ select revisionli0_.testCase_id as testCase10_2_, revisionli0_.id as id2_, revisionli0_.id as id37_1_, revisionli0_.author_login as author9_37_1_, revisionli0_.comment as comment37_1_, revisionli0_.createDate as createDate37_1_, revisionli0_.revision as revision37_1_, revisionli0_.visibility as visibility37_1_, revisionli0_.description as descript6_37_1_, revisionli0_.executionNumber as executio7_37_1_, revisionli0_.name as name37_1_, revisionli0_.testCase_id as testCase10_37_1_, user1_.login as login31_0_, user1_.email as email31_0_, user1_.fistName as fistName31_0_, user1_.lastName as lastName31_0_, user1_.password as password31_0_ from qs_revision_TestCase revisionli0_ left outer join qs_User user1_ on revisionli0_.author_login=user1_.login where revisionli0_.testCase_id=126 order by revisionli0_.revision DESC"
"2008-05-06 14:34:16","qsadmin[qsadmin] @ localhost [127.0.0.1]",37,0,"Query","/* */ select targetlist0_.testCaseRevisionList_id as testCase2_1_, targetlist0_.targetList_target as targetList1_1_, testtarget1_.target as target27_0_, testtarget1_.description as descript2_27_0_, testtarget1_.name as name27_0_ from qs_mapping_TestTarget targetlist0_ left outer join qs_TestTarget testtarget1_ on targetlist0_.targetList_target=testtarget1_.target where targetlist0_.testCaseRevisionList_id=250"
"2008-05-06 14:34:16","qsadmin[qsadmin] @ localhost [127.0.0.1]",37,0,"Query","/* */ select targetlist0_.testCaseRevisionList_id as testCase2_1_, targetlist0_.targetList_target as targetList1_1_, testtarget1_.target as target27_0_, testtarget1_.description as descript2_27_0_, testtarget1_.name as name27_0_ from qs_mapping_TestTarget targetlist0_ left outer join qs_TestTarget testtarget1_ on targetlist0_.targetList_target=testtarget1_.target where targetlist0_.testCaseRevisionList_id=249"
"2008-05-06 14:34:16","qsadmin[qsadmin] @ localhost [127.0.0.1]",37,0,"Query","/* */ select instructio0_.testCase_id as testCase2_1_, instructio0_.id as id1_, instructio0_.id as id29_0_, instructio0_.testCase_id as testCase2_29_0_ from qs_TestInstruction instructio0_ where instructio0_.testCase_id=127"
"2008-05-06 14:34:16","qsadmin[qsadmin] @ localhost [127.0.0.1]",37,0,"Query","/* */ select revisionli0_.testCase_id as testCase10_2_, revisionli0_.id as id2_, revisionli0_.id as id37_1_, revisionli0_.author_login as author9_37_1_, revisionli0_.comment as comment37_1_, revisionli0_.createDate as createDate37_1_, revisionli0_.revision as revision37_1_, revisionli0_.visibility as visibility37_1_, revisionli0_.description as descript6_37_1_, revisionli0_.executionNumber as executio7_37_1_, revisionli0_.name as name37_1_, revisionli0_.testCase_id as testCase10_37_1_, user1_.login as login31_0_, user1_.email as email31_0_, user1_.fistName as fistName31_0_, user1_.lastName as lastName31_0_, user1_.password as password31_0_ from qs_revision_TestCase revisionli0_ left outer join qs_User user1_ on revisionli0_.author_login=user1_.login where revisionli0_.testCase_id=127 order by revisionli0_.revision DESC"
"2008-05-06 14:34:16","qsadmin[qsadmin] @ localhost [127.0.0.1]",37,0,"Query","/* */ select targetlist0_.testCaseRevisionList_id as testCase2_1_, targetlist0_.targetList_target as targetList1_1_, testtarget1_.target as target27_0_, testtarget1_.description as descript2_27_0_, testtarget1_.name as name27_0_ from qs_mapping_TestTarget targetlist0_ left outer join qs_TestTarget testtarget1_ on targetlist0_.targetList_target=testtarget1_.target where targetlist0_.testCaseRevisionList_id=252"
"2008-05-06 14:34:16","qsadmin[qsadmin] @ localhost [127.0.0.1]",37,0,"Query","/* */ select targetlist0_.testCaseRevisionList_id as testCase2_1_, targetlist0_.targetList_target as targetList1_1_, testtarget1_.target as target27_0_, testtarget1_.description as descript2_27_0_, testtarget1_.name as name27_0_ from qs_mapping_TestTarget targetlist0_ left outer join qs_TestTarget testtarget1_ on targetlist0_.targetList_target=testtarget1_.target where targetlist0_.testCaseRevisionList_id=251"
"2008-05-06 14:34:16","qsadmin[qsadmin] @ localhost [127.0.0.1]",37,0,"Query","/* */ select instructio0_.testCase_id as testCase2_1_, instructio0_.id as id1_, instructio0_.id as id29_0_, instructio0_.testCase_id as testCase2_29_0_ from qs_TestInstruction instructio0_ where instructio0_.testCase_id=128"
"2008-05-06 14:34:16","qsadmin[qsadmin] @ localhost [127.0.0.1]",37,0,"Query","/* */ select revisionli0_.testCase_id as testCase10_2_, revisionli0_.id as id2_, revisionli0_.id as id37_1_, revisionli0_.author_login as author9_37_1_, revisionli0_.comment as comment37_1_, revisionli0_.createDate as createDate37_1_, revisionli0_.revision as revision37_1_, revisionli0_.visibility as visibility37_1_, revisionli0_.description as descript6_37_1_, revisionli0_.executionNumber as executio7_37_1_, revisionli0_.name as name37_1_, revisionli0_.testCase_id as testCase10_37_1_, user1_.login as login31_0_, user1_.email as email31_0_, user1_.fistName as fistName31_0_, user1_.lastName as lastName31_0_, user1_.password as password31_0_ from qs_revision_TestCase revisionli0_ left outer join qs_User user1_ on revisionli0_.author_login=user1_.login where revisionli0_.testCase_id=128 order by revisionli0_.revision DESC"
"2008-05-06 14:34:16","qsadmin[qsadmin] @ localhost [127.0.0.1]",37,0,"Query","/* */ select targetlist0_.testCaseRevisionList_id as testCase2_1_, targetlist0_.targetList_target as targetList1_1_, testtarget1_.target as target27_0_, testtarget1_.description as descript2_27_0_, testtarget1_.name as name27_0_ from qs_mapping_TestTarget targetlist0_ left outer join qs_TestTarget testtarget1_ on targetlist0_.targetList_target=testtarget1_.target where targetlist0_.testCaseRevisionList_id=254"
"2008-05-06 14:34:16","qsadmin[qsadmin] @ localhost [127.0.0.1]",37,0,"Query","/* */ select targetlist0_.testCaseRevisionList_id as testCase2_1_, targetlist0_.targetList_target as targetList1_1_, testtarget1_.target as target27_0_, testtarget1_.description as descript2_27_0_, testtarget1_.name as name27_0_ from qs_mapping_TestTarget targetlist0_ left outer join qs_TestTarget testtarget1_ on targetlist0_.targetList_target=testtarget1_.target where targetlist0_.testCaseRevisionList_id=253"
"2008-05-06 14:34:16","qsadmin[qsadmin] @ localhost [12 .....
Its is refreshing the WHOLE tree before dropping the group (i guess because of the cascade delete of the group) So THIS is the slow part now :(
So the question is: How can i avoid that the whole tree is refetched before the actuall delete? Do i have the owning classes wrong?