Fixing a race between the session being closed and the call to commit in the async handler that caused some exceptions occasionally in the test run.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1003908 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2010-10-02 22:23:55 +00:00
parent 227ed96df0
commit 5f490541f4
1 changed files with 8 additions and 8 deletions

View File

@ -116,12 +116,12 @@ public class JmsSchedulerTest extends EmbeddedBrokerTestSupport {
final CountDownLatch latch = new CountDownLatch(COUNT); final CountDownLatch latch = new CountDownLatch(COUNT);
consumer.setMessageListener(new MessageListener() { consumer.setMessageListener(new MessageListener() {
public void onMessage(Message message) { public void onMessage(Message message) {
latch.countDown();
try { try {
session.commit(); session.commit();
} catch (JMSException e) { } catch (JMSException e) {
e.printStackTrace(); e.printStackTrace();
} }
latch.countDown();
} }
}); });