Uploaded image for project: 'Jira Platform Cloud'
  1. Jira Platform Cloud
  2. JRACLOUD-31733

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

XMLWordPrintable

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      NOTE: This suggestion is for JIRA Cloud. Using JIRA Server? 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.

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

                Created:
                Updated:
                Resolved: