summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/trunk/modules/binding-jms-runtime/src
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-07-30 11:06:42 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-07-30 11:06:42 +0000
commit76af457fb057473b1af2a4b5c78f6444e9a953cc (patch)
tree5d1a5f07434b40cdf4284fd4142ea697da1e218d /sca-java-1.x/trunk/modules/binding-jms-runtime/src
parent39b7388edf3dfd82bf1ef6fe9046fefb717417de (diff)
TUSCANY-3634: ensure jms session is closed for oneway requests
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@980735 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/trunk/modules/binding-jms-runtime/src')
-rw-r--r--sca-java-1.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-1.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java b/sca-java-1.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
index 626e44f34f..ce02c81010 100644
--- a/sca-java-1.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
+++ b/sca-java-1.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
@@ -115,6 +115,7 @@ public class TransportServiceInterceptor implements Interceptor {
}
public Message invokeResponse(Message msg) {
+ JMSBindingContext context = msg.getBindingContext();
try {
//if operation is oneway, return back.
@@ -123,7 +124,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();
@@ -168,12 +168,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();
}
}