diff --git a/spring-jms/src/main/java/org/springframework/jms/listener/AbstractPollingMessageListenerContainer.java b/spring-jms/src/main/java/org/springframework/jms/listener/AbstractPollingMessageListenerContainer.java index 555cd6b8c39c..910125f80a69 100644 --- a/spring-jms/src/main/java/org/springframework/jms/listener/AbstractPollingMessageListenerContainer.java +++ b/spring-jms/src/main/java/org/springframework/jms/listener/AbstractPollingMessageListenerContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,8 +91,6 @@ public abstract class AbstractPollingMessageListenerContainer extends AbstractMe private long receiveTimeout = DEFAULT_RECEIVE_TIMEOUT; - private volatile Boolean commitAfterNoMessageReceived; - @Override public void setSessionTransacted(boolean sessionTransacted) { @@ -347,7 +345,6 @@ protected boolean doReceiveAndExecute( } noMessageReceived(invoker, sessionToUse); // Nevertheless call commit, in order to reset the transaction timeout (if any). - // However, don't do this on Tibco since this may lead to a deadlock there. if (shouldCommitAfterNoMessageReceived(sessionToUse)) { commitIfNecessary(sessionToUse, message); } @@ -381,17 +378,12 @@ protected boolean isSessionLocallyTransacted(Session session) { /** * Determine whether to trigger a commit after no message has been received. - * This is a good idea on any JMS provider other than Tibco, which is what - * this default implementation checks for. + * This is a good idea on any modern-day JMS provider. * @param session the current JMS Session which received no message * @return whether to call {@link #commitIfNecessary} on the given Session */ protected boolean shouldCommitAfterNoMessageReceived(Session session) { - if (this.commitAfterNoMessageReceived == null) { - Session target = ConnectionFactoryUtils.getTargetSession(session); - this.commitAfterNoMessageReceived = !target.getClass().getName().startsWith("com.tibco.tibjms."); - } - return this.commitAfterNoMessageReceived; + return true; } /**