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