HHH-7200 SessionFactoryObservers should be notified of the close event in reverse order of the create event

This commit is contained in:
Emmanuel Bernard 2012-03-27 15:44:16 +02:00
parent 74e5c3150d
commit d159dcef6f
1 changed files with 4 additions and 2 deletions

View File

@ -59,8 +59,10 @@ public class SessionFactoryObserverChain implements SessionFactoryObserver {
return; return;
} }
for ( SessionFactoryObserver observer : observers ) { //notify in reverse order of create notification
observer.sessionFactoryClosed( factory ); int size = observers.size();
for (int index = size - 1 ; index >= 0 ; index--) {
observers.get( index ).sessionFactoryClosed( factory );
} }
} }
} }