Uploaded image for project: 'Teiid Designer'
  1. Teiid Designer
  2. TEIIDDES-1406

Use of ModellerCore.startTxn do not always set a succeeded variable to true causing an erroneous transaction rollback

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 8.0
    • None
    • None
    • None
    • Medium

    Description

      boolean started = ModelerCore.startTxn(false, false, "Some task", this);
      boolean succeeded = false;
      
      try {
        // do something useful here
      
        // This succeeded is not always set to true
        succeeded = true;
      
      } catch (final Exception err) {
      
        // log the exception
      
      } finally {
        if (started) {
          if (succeeded) {
            ModelerCore.commitTxn();
          } else {
            ModelerCore.rollbackTxn();
          }
        }
      }
      

      There are around 300+ instances of the call to startTxn and not all set succeeded to true.

      • Better to fix this by creating a transaction callback interface that anonymous classes can implement to wrap the work.
      • The succeeded flag is handled internally by the transaction framework.
      • All transactions handled in the same way and the succeeded flag dealt with uniformly.

      Attachments

        Activity

          People

            parichar@redhat.com Paul Richardson
            parichar@redhat.com Paul Richardson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: