fix Session#refresh() exception

This commit is contained in:
Andrea Boriero 2016-04-27 18:51:45 +01:00 committed by Steve Ebersole
parent d2ac092992
commit 33c4f3b5b5
1 changed files with 27 additions and 10 deletions

View File

@ -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();
}