0 Replies Latest reply on Aug 2, 2008 8:58 PM by jonathanztaub

    Nested transaction is not working

    jonathanztaub Newbie

      I have a message driven bean which also persists data to the database.
      In case data persistence fails, I just log out an error and rollback the transaction. This causes the JMS transaction to be rolled back as well, resulting in redelivery of the message.

      I'm not interested in message redelivery so I created another method in the message driven bean, and configured it to have a RequiresNew transaction attribute in the ejb-jar.xml. The idea is that if database persistence fail, I can perform a rollback in the second method, thereby rolling back only the database transaction. However, this doesn't seem to work as the JMS transaction is rolledback as well.

      My questions are:
      * Am I misunderstanding how transaction demarcation and rollback work?
      * Are there specific issues with JMS I'm unaware of?