mirror of https://github.com/apache/activemq.git
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@691124 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
47cfa5590b
commit
f5703497dd
|
@ -296,6 +296,9 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
|
||||||
public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException {
|
public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException {
|
||||||
checkClosedOrFailed();
|
checkClosedOrFailed();
|
||||||
ensureConnectionInfoSent();
|
ensureConnectionInfoSent();
|
||||||
|
if(!transacted && acknowledgeMode==Session.SESSION_TRANSACTED) {
|
||||||
|
throw new JMSException("acknowledgeMode SESSION_TRANSACTED cannot be used for an non-transacted Session");
|
||||||
|
}
|
||||||
return new ActiveMQSession(this, getNextSessionId(), transacted ? Session.SESSION_TRANSACTED : (acknowledgeMode == Session.SESSION_TRANSACTED
|
return new ActiveMQSession(this, getNextSessionId(), transacted ? Session.SESSION_TRANSACTED : (acknowledgeMode == Session.SESSION_TRANSACTED
|
||||||
? Session.AUTO_ACKNOWLEDGE : acknowledgeMode), isDispatchAsync(), isAlwaysSessionAsync());
|
? Session.AUTO_ACKNOWLEDGE : acknowledgeMode), isDispatchAsync(), isAlwaysSessionAsync());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue