summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-07-30 11:02:26 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-07-30 11:02:26 +0000
commit39b7388edf3dfd82bf1ef6fe9046fefb717417de (patch)
tree47d25e76b2b90c4299a3a83e729be6452678234f /sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org
parent651a28b26242e25fddbdfe124e6b8d6448633a0a (diff)
TUSCANY-3634: ensure jms session is closed for oneway requests
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@980734 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org')
-rw-r--r--sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
index 1a175ce026..8695a760a1 100644
--- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
+++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
@@ -120,6 +120,7 @@ public class TransportServiceInterceptor implements Interceptor {
}
public Message invokeResponse(Message msg) {
+ JMSBindingContext context = msg.getBindingContext();
try {
//if operation is oneway, return back.
@@ -128,7 +129,6 @@ public class TransportServiceInterceptor implements Interceptor {
return msg;
}
- JMSBindingContext context = msg.getBindingContext();
Session session = context.getJmsResponseSession();
javax.jms.Message requestJMSMsg = context.getJmsMsg();
javax.jms.Message responseJMSMsg = msg.getBody();
@@ -173,12 +173,13 @@ public class TransportServiceInterceptor implements Interceptor {
producer.send((javax.jms.Message)msg.getBody());
producer.close();
- context.closeJmsResponseSession();
return msg;
} catch (JMSException e) {
throw new JMSBindingException(e);
+ } finally {
+ context.closeJmsResponseSession();
}
}