File tree 1 file changed +7
-1
lines changed
spring-jms/src/main/java/org/springframework/jms/connection 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ public boolean isCacheConsumers() {
186
186
@ Override
187
187
public void resetConnection () {
188
188
this .active = false ;
189
+
189
190
synchronized (this .cachedSessions ) {
190
191
for (LinkedList <Session > sessionList : this .cachedSessions .values ()) {
191
192
synchronized (sessionList ) {
@@ -201,17 +202,22 @@ public void resetConnection() {
201
202
}
202
203
this .cachedSessions .clear ();
203
204
}
204
- this .active = true ;
205
205
206
206
// Now proceed with actual closing of the shared Connection...
207
207
super .resetConnection ();
208
+
209
+ this .active = true ;
208
210
}
209
211
210
212
/**
211
213
* Checks for a cached Session for the given mode.
212
214
*/
213
215
@ Override
214
216
protected Session getSession (Connection con , Integer mode ) throws JMSException {
217
+ if (!this .active ) {
218
+ return null ;
219
+ }
220
+
215
221
LinkedList <Session > sessionList ;
216
222
synchronized (this .cachedSessions ) {
217
223
sessionList = this .cachedSessions .get (mode );
You can’t perform that action at this time.
0 commit comments