Let me first give a brief introduction of the business scenario -
I am using JMS Queues and I have a Java application which listens on this queue constantly. Wheneever, there is a message on this queue, it is picked by this Java application and a stored procedure is called internally and the data from the message is stored in the database tables.In an ideal scenario,the message would be succesfully parsed and the data would be succesfully commited into the database and then the Queue would be committed.
The problem with this approach Imagine now, that due to some reasons, the database commit was succesful but the Queue commit fails. In this scenario, the same message would be picked by the java application listening on the Queue and all the cycle repeats again which is not desirable at all.
So, I am looking for a solution wherein either both the database and the Queue commit or both Rollback.