Skip to content

Commit 8543a55

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

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
@@ -305,9 +305,15 @@ else if (methodName.equals("close")) {
305305
if (active) {
306306
synchronized (this.sessionList) {
307307
if (this.sessionList.size() < getSessionCacheSize()) {
308-
logicalClose((Session) proxy);
309-
// Remain open in the session list.
310-
return null;
308+
try {
309+
logicalClose((Session) proxy);
310+
// Remain open in the session list.
311+
return null;
312+
}
313+
catch (JMSException ex) {
314+
logger.trace("Logical close of cached JMS Session failed - discarding it", ex);
315+
// Proceed to physical close from here...
316+
}
311317
}
312318
}
313319
}

0 commit comments

Comments
 (0)