Torque
  1. Torque
  2. TORQUE-119

Method "save" doesn't handle exceptions which results in unsavable objects

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 4.0-beta1
    • Component/s: Generator
    • Labels:
      None

      Description

      In the method "public void save(Connection con) throws TorqueException" (generated by templates>om>Object) the field "alreadyInSave" indicates that there is an ongoing save process. In the beginning it is set to "true", at the end it is set back to "false". But if an exception occurs (while calling doInsert(...) or doUpdate(...)) this field will not be set back to false 'cause the method throws this exception immediately. So afterwards it isn't possible to save an object using this method.

      proposal for fix:
      Wrap the "internal" of the save method with a "try

      { ... } finally { ... }

      " - statement and in the finally set the field "alreadyInSave" to false.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Thomas Fox
            Reporter:
            Florian Liese
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development