[ 
https://issues.apache.org/jira/browse/AMQ-7177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zheng Feng updated AMQ-7177:
----------------------------
    Description: 
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().

  was:
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}


> 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
>
> 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