Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-2970

In POJO mode, seam 2.0.2 performs a commit on the transaction even if the transaction si marked for rollback

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.0.2.CR2
    • Fix Version/s: 2.0.2.GA, 2.1.0.BETA1
    • Component/s: None
    • Labels:
      None

      Description

      The logic for performing the commit on a transaction should take into account that the transaction is marked for rollback or not.
      In Work.java, the could should be:
      T result = work();
      if (begin) {
      if (Transaction.instance().isMarkedRollback())

      { log.debug("transaction isMarkedRollback. rolling back transaction"); userTransaction.rollback(); }

      else

      { log.debug("committing transaction"); userTransaction.commit(); }

      }
      return result;
      In the current code, the call to userTransaction.commit() is attempted even if Transaction.instance().isMarkedRollback() is true! This is the case if we call Transaction.instance().setRollbackOnly() in a method annoted with @Transactional
      See also the "TODO" marker in the code of this class

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                pmuir Pete Muir
                Reporter:
                titou09 titou10 titou10
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: