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

Enable ActiveObjects transaction support in JIRA

XMLWordPrintable

    • 1
    • 2
    • 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.

      ActiveObjects provides support for transactions using SAL's SalTransactionManager.inTransaction(). This does not work in JIRA, since down the road this call lands in DefaultHostContextAccessor.doInTransaction(), which is a no-op.

      This means that all transaction support AO provides does not get passed down to the JDBC level. This is critical since it gives plugin developers the false impression that they've got transactionality in their code, while they effectively have not.

      Workaround

      As mentioned by andrei1176810792 in this comment, add-on vendors can manually create transactions as a workaround:

      import com.atlassian.jira.transaction.Transaction;
      import com.atlassian.jira.transaction.Txn;
      
      
          Transaction txn = Txn.begin();
          try {
              ...
              txn.commit();
              ...
          } finally {
              txn.finallyRollbackIfNotCommitted();
          }
      

              Unassigned Unassigned
              ahennecke Alex Hennecke (Inactive)
              Votes:
              90 Vote for this issue
              Watchers:
              89 Start watching this issue

                Created:
                Updated: