1 Reply Latest reply on Nov 10, 2002 3:29 PM by Adrian Brock

    Transaction rollback

    Erik Turesson Novice


      I have posted some questions about problem with transactionhandling without getting any answers. I am now trying to ask a more general question about transactions.

      I am using Jboss 3.0.4, Stateless Session beans and CMP Entity beans. My entity beans are marked "Instance Per Transaction CMP 2.x EntityBean".

      My session beans declares the transaction Requeried or now for testing RequiresNew. I do not create any UserTransactions in my jsp code that access the session beans, i e I let Jboss create the transactions for me. When an error is detected by the session beans I marke the sessioncontext attribute with setRollbackOnly.

      What is supposed to happen with the transaction JBoss have created? Is it to be rollbacked automaticaly by Jboss, or do I have to do it manually in my jsp code?

      If I have the transaction attribute set to RequiresNew this is what happens. After 5 minutes a printout like this is shown:

      2002-11-10 18:13:23,725 WARN [org.jboss.tm.TxCapsule] Transaction XidImpl [FormatId=257, GlobalId=ertu//5313, BranchQual=] timed out. status=STATUS_MARKED_ROLLBACK

      To me it seems that if I only mark the sessioncontext to setRollbackOnly the transaction is only marked for rollback not actually rolled back. Do I have to do something else to get the transaction rolled back and removed from the system?


        • 1. Re: Transaction rollback
          Adrian Brock Master

          The transaction should be rolled back when the
          transaction ends. In your case this will be when the
          session bean invocation returns to the jsp.

          Try configuring TRACE in log4j.xml for
          so you can see what is happening in more detail.
          You will need to remove the INFO threshold
          from the file appender.