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

Gary Tully commented on AMQ-7177:
---------------------------------

This is one of those undefined JMS areas. See: 
[https://docs.oracle.com/javaee/6/api/javax/jms/XAConnection.html#createSession(boolean,%20int)]

By using the override to return an XASession that throws on commit/rollback, 
the behaviour is being defined as an error and it has been like this from day 
one.

For the consumer case, see: 
[AMQ-2659|https://jira.apache.org/jira/browse/AMQ-2659] there is the option to 
specify the ack mode required through config, but it can't be transacted.

There would need to be lots of tests to verify any new behaviour b/c this 
scenario would not have been possible before.

 

thinking more, there could be some users that expect auto ack, irrespective of 
the args that are passed into the createSession call, if it now delegates, this 
could break existing code.

I don't know if this would be a flier.

 

> ActiveMQXAConnection should not override the createSession method
> -----------------------------------------------------------------
>
>                 Key: AMQ-7177
>                 URL: https://issues.apache.org/jira/browse/AMQ-7177
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>            Reporter: Zheng Feng
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> It should not override the method of the super class. And in the term of the 
> [JMS spec|https://docs.oracle.com/javaee/7/api/javax/jms/XAConnection.html], 
> it needs to return the Session but not the XASession.
> {code:java}
> public Session createSession(boolean transacted, int acknowledgeMode) throws 
> JMSException {
>     checkClosedOrFailed();
>     ensureConnectionInfoSent();
>     return new ActiveMQXASession(this, getNextSessionId(), getAckMode(), 
> isDispatchAsync());
> }
> {code}
> The simple fix could change the method name createSession() to 
> createSessionInternal().



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to