JMS Transaction COMMIT error
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.
Comments
-
Hi @SasikumarSP,
Hmm. I haven't seen this one before. Can you share your code?
Also can you verify that your client-profile has theallow-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.htm0 -
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.
0 -
Hi @marc , @SasikumarSP any work around to avoid this error? Is there explicit way to commit the messages?
0 -
Hey @vshivk99,
Yes, you would commit by invokingcommit()
in the JMS API.
Using transacted sessions is explained in the Solace docs here: https://docs.solace.com/Solace-JMS-API/Using-Transacted-Sessions.htmHope that helps
0