HHH-18140 Skip optimizeUnloadedDelete if there are POST_COMMIT_DELETE listeners

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-05-20 15:34:10 +02:00 committed by Christian Beikov
parent 985c6e4001
commit 4f15299807
1 changed files with 1 additions and 0 deletions

View File

@ -276,6 +276,7 @@ public class DefaultDeleteEventListener implements DeleteEventListener, Callback
// Bean Validation adds a PRE_DELETE listener
// and Envers adds a POST_DELETE listener
return fss.eventListenerGroup_PRE_DELETE.count() > 0
|| fss.eventListenerGroup_POST_COMMIT_DELETE.count() > 0
|| fss.eventListenerGroup_POST_DELETE.count() > 1
|| fss.eventListenerGroup_POST_DELETE.count() == 1
&& !(fss.eventListenerGroup_POST_DELETE.listeners().iterator().next()