[ 
https://issues.apache.org/jira/browse/ARTEMIS-1331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17836248#comment-17836248
 ] 

Justin Bertram commented on ARTEMIS-1331:
-----------------------------------------

I'm torn on this. [This functionality was 
added|https://github.com/hornetq/hornetq/commit/7c20a043a979497ddaa9a4f46d2f7f9c500f3c43]
 way back in HornetQ apparently in order to pass the JMS 2 TCK. However, I 
can't find the test referenced in the commit message in the TCK. In fact, I 
can't find any test in the TCK that uses this combination of parameters for 
{{createSession}}.

The JavaDoc for {{createSession}} states:
{quote}
In a *Java SE environment* or in the *Java EE application client container*:
* If transacted is set to {{true}} then the session will use a local 
transaction which may subsequently be committed or rolled back by calling the 
session's {{commit}} or {{rollback}} methods. The argument {{acknowledgeMode}} 
is ignored.
* If transacted is set to {{false}} then the session will be non-transacted. In 
this case the argument {{acknowledgeMode}} is used to specify how messages 
received by this session will be acknowledged. The permitted values are 
{{Session.CLIENT_ACKNOWLEDGE}}, {{Session.AUTO_ACKNOWLEDGE}} and 
{{Session.DUPS_OK_ACKNOWLEDGE}}. For a definition of the meaning of these 
acknowledgement modes see the links below.{quote}
Later it says that a {{JMSException}} may be thrown if there is a, "...lack of 
support for the specific transaction and acknowledgement mode..."

> JMS test ConnectionTest#testTXTypeInvalid passes with Core JMS 
> (artemis-jms-client) and fails with the other ones
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-1331
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1331
>             Project: ActiveMQ Artemis
>          Issue Type: Test
>    Affects Versions: 2.3.0
>            Reporter: Jiri Daněk
>            Priority: Trivial
>
> Consider 
> {{org.apache.activemq.artemis.tests.integration.jms.client.ConnectionTest#testTXTypeInvalid}}.
> If you do 
> {noformat}
>       Session sess = conn.createSession(false, Session.SESSION_TRANSACTED);
> {noformat}
> then Core JMS does not throw {{javax.jms.JMSException: acknowledgeMode 
> SESSION_TRANSACTED cannot be used for an non-transacted Session}}, the other 
> JMS clients do.
> So either Core or the other clients do something wrong.
> (See full reproducer at 
> https://github.com/jdanekrh/jms-reproducers/blob/master/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to