diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryObserverChain.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryObserverChain.java index 90d4e2de40..6e383449fd 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryObserverChain.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryObserverChain.java @@ -59,8 +59,10 @@ public class SessionFactoryObserverChain implements SessionFactoryObserver { return; } - for ( SessionFactoryObserver observer : observers ) { - observer.sessionFactoryClosed( factory ); + //notify in reverse order of create notification + int size = observers.size(); + for (int index = size - 1 ; index >= 0 ; index--) { + observers.get( index ).sessionFactoryClosed( factory ); } } }