File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
hibernate-core/src/main/java/org/hibernate/engine/internal Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1212import org .hibernate .engine .spi .TransactionCompletionCallbacks .AfterCompletionCallback ;
1313
1414import java .util .HashSet ;
15+ import java .util .Iterator ;
1516import java .util .Set ;
1617
1718import static org .hibernate .internal .CoreMessageLogger .CORE_LOGGER ;
@@ -62,13 +63,15 @@ void afterTransactionCompletion(boolean success) {
6263 }
6364
6465 void executePendingBulkOperationCleanUpActions () {
65- AfterCompletionCallback process ;
6666 boolean hasPendingBulkOperationCleanUpActions = false ;
67- while ( ( process = processes .poll () ) != null ) {
67+ Iterator <AfterCompletionCallback > iterator = processes .iterator ();
68+ while ( iterator .hasNext () ) {
69+ AfterCompletionCallback process = iterator .next ();
6870 if ( process instanceof BulkOperationCleanupAction .BulkOperationCleanUpAfterTransactionCompletionProcess ) {
6971 try {
7072 hasPendingBulkOperationCleanUpActions = true ;
7173 process .doAfterTransactionCompletion ( true , session );
74+ iterator .remove ();
7275 }
7376 catch (CacheException ce ) {
7477 CORE_LOGGER .unableToReleaseCacheLock ( ce );
You can’t perform that action at this time.
0 commit comments