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

Guillaume Nodet resolved SM-981.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 3.1.3
         Assignee: Guillaume Nodet

Thanks a lot for this patch!

Sending        
servicemix-jms/src/main/java/org/apache/servicemix/jms/jca/JcaProviderProcessor.java
Transmitting file data .
Committed revision 580020.

Sending        
servicemix-jms/src/main/java/org/apache/servicemix/jms/jca/JcaProviderProcessor.java
Transmitting file data .
Committed revision 580023.

> Transaction Exception due to ServiceMix JMS Provider
> ----------------------------------------------------
>
>                 Key: SM-981
>                 URL: https://issues.apache.org/activemq/browse/SM-981
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-jms
>    Affects Versions: 3.1
>         Environment: All platforms. The bug was encountered on ServiceMix 3.1 
> running in JBoss against JBossMQ.
>            Reporter: Martin Landua
>            Assignee: Guillaume Nodet
>             Fix For: 3.1.3, 3.2
>
>         Attachments: servicemix-jms.patch
>
>
> Hi all,
> under heavy load, we have encountered a problem when writing messages using 
> the JMS provider in a synchronous, transactional flow.
> The problem is that in the code (lines 100 and up)
>             producer.send(msg);
>             exchange.setStatus(ExchangeStatus.DONE);
>             channel.send(exchange);
>         } finally {
>             if (session != null) {
>                 session.close();
>             }
>             if (connection != null) {
>                 connection.close();
>             }
>         }
> it is possible that the DONE state would return to the originator faster than 
> the session and the connection is closed in the finally section. If this 
> happens, the originator (and therefore owner of the transaction) will first 
> commit and after this the provider would close the connection.
> This results in a transaction exception.
> From what we can tell, it should read like this:
>             producer.send(msg);
>         } finally {
>             if (session != null) {
>                 session.close();
>             }
>             if (connection != null) {
>                 connection.close();
>             }
>         }
>             exchange.setStatus(ExchangeStatus.DONE);
>             channel.send(exchange);
> due to which we guarantee that the connection is safely closed before we send 
> the confirmation back to the consumer.
> All of our load tests succeeded after this change.
> Best regards
> Martin Landua

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to