diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java index 0399a0eca9..ca99846fd1 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java @@ -1229,21 +1229,38 @@ public final class SessionImpl } private void fireRefresh(RefreshEvent event) { - checkOpen(); - checkTransactionSynchStatus(); - for ( RefreshEventListener listener : listeners( EventType.REFRESH ) ) { - listener.onRefresh( event ); + try { + checkOpen(); + checkTransactionSynchStatus(); + for ( RefreshEventListener listener : listeners( EventType.REFRESH ) ) { + listener.onRefresh( event ); + } + } + catch (RuntimeException e) { + //including HibernateException + throw convert( e ); + } + finally { + delayedAfterCompletion(); } - delayedAfterCompletion(); } private void fireRefresh(Map refreshedAlready, RefreshEvent event) { - checkOpen(); - checkTransactionSynchStatus(); - for ( RefreshEventListener listener : listeners( EventType.REFRESH ) ) { - listener.onRefresh( event, refreshedAlready ); + try { + checkOpen(); + checkTransactionSynchStatus(); + for ( RefreshEventListener listener : listeners( EventType.REFRESH ) ) { + listener.onRefresh( event, refreshedAlready ); + } + delayedAfterCompletion(); + } + catch (RuntimeException e) { + //including HibernateException + throw convert( e ); + } + finally { + delayedAfterCompletion(); } - delayedAfterCompletion(); }