jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1619932 - in /jmeter/trunk: src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java xdocs/changes.xml
Date Fri, 22 Aug 2014 21:11:17 GMT
Author: pmouawad
Date: Fri Aug 22 21:11:17 2014
New Revision: 1619932

URL: http://svn.apache.org/r1619932
Log:
Bug 56809 - JMSSampler closes InitialContext too early
Bugzilla Id: 56809

Modified:
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java?rev=1619932&r1=1619931&r2=1619932&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java (original)
+++ jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java Fri
Aug 22 21:11:17 2014
@@ -127,6 +127,8 @@ public class JMSSampler extends Abstract
 
     private transient Throwable thrown = null;
 
+    private transient Context context = null;
+
     /**
      * {@inheritDoc}
      */
@@ -321,7 +323,6 @@ public class JMSSampler extends Abstract
     public void threadStarted() {
         logThreadStart();
 
-        Context context = null;
         thrown = null;
         try {
             context = getInitialContext();
@@ -391,14 +392,6 @@ public class JMSSampler extends Abstract
         } catch (NoClassDefFoundError e) {
             thrown = e;
             LOGGER.error(e.getLocalizedMessage(), e);
-        } finally {
-            if (context != null) {
-                try {
-                    context.close();
-                } catch (NamingException ignored) {
-                    // ignore
-                }
-            }
         }
     }
 
@@ -490,6 +483,13 @@ public class JMSSampler extends Abstract
     public void threadFinished() {
         LOGGER.debug("Thread ended " + new Date());
 
+        if (context != null) {
+            try {
+                context.close();
+            } catch (NamingException ignored) {
+                // ignore
+            }
+        }
         Utils.close(session, LOGGER);
         Utils.close(connection, LOGGER);
         if (receiverThread != null) {

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1619932&r1=1619931&r2=1619932&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Fri Aug 22 21:11:17 2014
@@ -150,6 +150,7 @@ jmeter.gui.action.LookAndFeelCommand: Us
 <li><bugzilla>56428</bugzilla> - MailReaderSampler - should it use mail.pop3s.*
properties?</li>
 <li><bugzilla>46932</bugzilla> - Alias given in select statement is not
used as column header in response data for a JDBC request.Based on report and analysis of
Nicola Ambrosetti</li>
 <li><bugzilla>56539</bugzilla> - Mail reader sampler: When Number of messages
to retrieve is superior to 1, Number of samples should only show 1 not the number of messages
retrieved</li>
+<li><bugzilla>56809</bugzilla> - JMSSampler closes InitialContext too early.
Contributed by Bradford Hovinen (hovinen at gmail.com)</li>
 </ul>
 
 <h3>Controllers</h3>
@@ -275,6 +276,7 @@ jmeter.gui.action.LookAndFeelCommand: Us
 <li>Felix Schumacher (felix.schumacher at internetallee.de)</li>
 <li>Dzmitry Kashlach (dzmitrykashlach at gmail.com)</li>
 <li>Andrey Pohilko (apc4 at ya.ru)</li>
+<li>Bradford Hovinen (hovinen at gmail.com)</li>
 </ul>
 
 <br/>



Mime
View raw message