Browse Source

CachingConnectionFactory proceeds to physicalClose in case of logicalClose exceptions

Issue: SPR-12148
pull/598/head
Juergen Hoeller 11 years ago
parent
commit
82f8b4330c
  1. 12
      spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java

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

@ -305,9 +305,15 @@ public class CachingConnectionFactory extends SingleConnectionFactory { @@ -305,9 +305,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...
}
}
}
}

Loading…
Cancel
Save