Interface TransactionSupport

All Known Implementing Classes:
TransactionSupportImpl

public interface TransactionSupport
Represents the ability to peform a database transaction in JIRA.
Since:
v4.4.1
  • Method Summary

    Modifier and Type
    Method
    Description
    This begins a new transaction if one is not already running for this thread.
    default void
    execute(Runnable callback)
     
    default <T> T
    execute(Supplier<T> callback)
     
  • Method Details

    • begin

      This begins a new transaction if one is not already running for this thread.

      It will be a NoOp if a transaction is already running and in this case a call to Transaction.commit() will also be a NoOp. The outer caller is then reponsible for the ultimate commit or rollback.

      It will also be a NoOp if a transaction support in JIRA is turned off.

      Returns:
      a Transaction context object that you can called commit or rollback on
      Throws:
      TransactionRuntimeException - if the transaction can not be established at all
    • execute

      default <T> T execute(Supplier<T> callback)
    • execute

      default void execute(Runnable callback)