1 Reply Latest reply on Feb 4, 2009 11:08 AM by Guillermo L

    Rollback UserTransaction within a POJO ignored?

    Guillermo L Newbie

      I'm developing an application that uses JBossMQ and has to ensure operation atomicity. I have a thread that reads messages from a queue and puts them into another queue so if an error occurs the operation/transaction has to be rolled back. This POJO is getting the UserTransaction from JNDI, beginning the transaction, doing some JMS operations and then commit() or rollback().

      The problem is that whenever an error occurs even the rollback is executed it happens to be ignored without any error and commits anyway (without explicitly calling the commit from application code).

      Just as a comment the application uses Spring. I don´t know whether this can be an issue or not...

      Any help HIGHLY appreciated :-)!

        • 1. Re: Rollback UserTransaction within a POJO ignored?
          Guillermo L Newbie

          Finally I've found the problem myself reviewing the code which I should be doing before posting anything. As per what I'm writing you noticed that the problem was on the application code and I'll post the explanation of the "horror" :D so if anybody has the same problem may waste less time in it.

          Check that you begin() the transaction before getting any resource you might want to be included in that transaction!