Skip to content

Commit 4255774

Browse files
committed
CachingConnectionFactory proceeds to physicalClose in case of logicalClose exceptions
Issue: SPR-12148 (cherry picked from commit 82f8b43)
1 parent d18bdf6 commit 4255774

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,15 @@ else if (methodName.equals("close")) {
298298
if (active) {
299299
synchronized (this.sessionList) {
300300
if (this.sessionList.size() < getSessionCacheSize()) {
301-
logicalClose((Session) proxy);
302-
// Remain open in the session list.
303-
return null;
301+
try {
302+
logicalClose((Session) proxy);
303+
// Remain open in the session list.
304+
return null;
305+
}
306+
catch (JMSException ex) {
307+
logger.trace("Logical close of cached JMS Session failed - discarding it", ex);
308+
// Proceed to physical close from here...
309+
}
304310
}
305311
}
306312
}

0 commit comments

Comments
 (0)