Details

    • Rice Module:
      KEW

      Description

      There appears to be some sort of issue with the document type versioning in workflow. What appears to be happening on occasion is that a document type will end up pointing to a parent document type that is not marked as "current". I haven't had a chance to try determine whether this is reproducible or not.

        Attachments

          Issue Links

            Activity

            Hide
            ewestfal Eric Westfall added a comment -

            This is a concurrency issue. Here's the condition under which this occurs:

            1) Transaction A begins
            2) Transaction A creates a new copy of parent doctype for a new version
            3) Transaction B begins
            4) Transaction B is creating a new document type
            5) Transaction B creates the new doctype to point to the current parent (our parent which is in the process of being reversioned by Transaction A).
            6) Transaction A flips the current indicator of the old doc type to 0 and the current indicator of the new one to 1.
            7) Transaction A re-points all existing children doc types to the new parent (except of course the one being created by Transaction B because of transaction visibility) and saves everything.
            8) Transaction A commits.
            9) Transaction B save it's new document type.

            At this point, the document type created by transaction B is pointing to a parent document type which is no longer current.

            Show
            ewestfal Eric Westfall added a comment - This is a concurrency issue. Here's the condition under which this occurs: 1) Transaction A begins 2) Transaction A creates a new copy of parent doctype for a new version 3) Transaction B begins 4) Transaction B is creating a new document type 5) Transaction B creates the new doctype to point to the current parent (our parent which is in the process of being reversioned by Transaction A). 6) Transaction A flips the current indicator of the old doc type to 0 and the current indicator of the new one to 1. 7) Transaction A re-points all existing children doc types to the new parent (except of course the one being created by Transaction B because of transaction visibility) and saves everything. 8) Transaction A commits. 9) Transaction B save it's new document type. At this point, the document type created by transaction B is pointing to a parent document type which is no longer current.
            Hide
            ewestfal Eric Westfall added a comment -

            Fixed this by forcing a save of the parent document type when a child is saved. This causes a version check to be made and if the above scenario occurs, an optimistic lock will be thrown from one of the 2 transactions. This won't be pretty for the user but they should be able to try their import again and be in good shape. Document Type updates aren't very frequent so I think this issue should suffice and fix the integrity issues.

            Show
            ewestfal Eric Westfall added a comment - Fixed this by forcing a save of the parent document type when a child is saved. This causes a version check to be made and if the above scenario occurs, an optimistic lock will be thrown from one of the 2 transactions. This won't be pretty for the user but they should be able to try their import again and be in good shape. Document Type updates aren't very frequent so I think this issue should suffice and fix the integrity issues.
            Hide
            agodert Aaron Godert (Inactive) added a comment -

            Seems like an appropriate fix for an infrequent condition.

            Show
            agodert Aaron Godert (Inactive) added a comment - Seems like an appropriate fix for an infrequent condition.

              People

              • Assignee:
                ewestfal Eric Westfall
                Reporter:
                ewestfal Eric Westfall
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: