🎄 Happy Holidays! 🥳

Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.

Happy Holidays!

Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.

JMS Transaction COMMIT error

SasikumarSP
SasikumarSP Member Posts: 31 ✭✭

Hi Team,

I have seen this error in logs. Can someone explains me when this error occurs and what happens to messages?

javax.jms.JMSException: Error committing - internal error (Operation COMMIT disallowed in state COMMITTING.)
Caused by: com.solacesystems.jcsmp.InvalidOperationException: Operation COMMIT disallowed in state COMMITTING.

Tagged:

Comments

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 963 admin
    edited April 2021 #2

    Hi @SasikumarSP,

    Hmm. I haven't seen this one before. Can you share your code?
    Also can you verify that your client-profile has the allow-transacted-sessions property enabled? (It is disabled by default). Info on this docs page might also give you a hint. https://docs.solace.com/Solace-JMS-API/Using-Transacted-Sessions.htm

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 963 admin

    Hey @SasikumarSP,

    I got some info from our support team that should help you troubleshoot. It seems like your app is likely calling commit from multiple threads. Hopefully that will help!

    The issue here is that the application is calling javax.jms.Session.commit() when an outstanding commit is already in progress. Because commit() is a blocking function that only returns after the commit operation is completed, this indicates that there must be multiple threads calling commit().

    Do note that JMS sessions do not support concurrent use. This is defined in section "2.8 Multithreading" of the JMS 1.1 specification.

  • vshivk99
    vshivk99 Member Posts: 13
    edited May 2021 #4

    Hi @marc , @SasikumarSP any work around to avoid this error? Is there explicit way to commit the messages?

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 963 admin

    Hey @vshivk99,
    Yes, you would commit by invoking commit() in the JMS API.
    Using transacted sessions is explained in the Solace docs here: https://docs.solace.com/Solace-JMS-API/Using-Transacted-Sessions.htm

    Hope that helps :)

  • vshivk99
    vshivk99 Member Posts: 13

    Thanks for the response