0 Replies Latest reply on Feb 25, 2004 12:19 PM by Rudi Vankeirsbilck

    Getting new UserTransaction and it is alread marked for roll

    Rudi Vankeirsbilck Newbie

      Hi all,

      I have the following code in a server side testcase (cactus):

      this.userTransaction = (UserTransaction) getInitialContext().lookup("java:comp/UserTransaction");
      System.out.println("Returned user transaction has status " + this.userTransaction.getStatus());

      Most of the time this goes fine and I can see status 6 (STATUS_NO_TRANSACTION). Other times however, the status is 1 (STATUS_MARKED_ROLLBACK) as if I am reusing a UserTransaction from a previous test case that was marked for rollback.
      I am quite sure that the previous test case has rolled back the transaction (does that in tearDown).

      The problem is that I get an exception when I try to start the transaction.

      Can anybody help me out here?

      Many thanks,