CachingConnectionFactory proceeds to physicalClose in case of logicalClose exceptions

Issue: SPR-12148
(cherry picked from commit 82f8b43)
This commit is contained in:
Juergen Hoeller
2014-09-04 00:36:17 +02:00
parent d18bdf6448
commit 42557743e8

View File

@@ -298,9 +298,15 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
if (active) {
synchronized (this.sessionList) {
if (this.sessionList.size() < getSessionCacheSize()) {
logicalClose((Session) proxy);
// Remain open in the session list.
return null;
try {
logicalClose((Session) proxy);
// Remain open in the session list.
return null;
}
catch (JMSException ex) {
logger.trace("Logical close of cached JMS Session failed - discarding it", ex);
// Proceed to physical close from here...
}
}
}
}