Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-31733

Run all issue event listeners inside the database transaction that writes the issue data

    XMLWordPrintable

Details

    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? See the corresponding suggestion.

      The current DB transaction boundaries are inconsistent:

      • Many actions call DefaultIssueUpdater.doUpdate() which updates the issue and adds the change group inside one transaction but then commits it and switches to autocommit before dispatching the issue event
      • Adding a comment uses DefaultCommentManager.create() which doesn't use a transaction at all
      • Doing a workflow step uses OSWorkflowManager.doWorkflowAction() which does everything in one transaction
      • There may be other cases that fire issue events, I haven't looked very thoroughly.

      My use case is an issue event listener that updates an activeobject which must stay in sync with the issue. So I would like that every time the listener runs it is inside the relevant transaction not just for workflow steps.

      When making this issue I didn't notice that AOs use their own database connection so it's not that simple to get everything into one transaction. Nonetheless this issue is something worth tidying up or at least noting in the event listener documentation.

      Attachments

        Issue Links

          Activity

            People

              astarr Anthony Starr [Atlassian] (Inactive)
              6a9ecfd57b3c Matthew Leather
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: