Enable ActiveObjects transaction support in JIRA

XMLWordPrintable

    • 1
    • 4

      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();
          }
      

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

              Created:
              Updated: