Class TransactionHelper

java.lang.Object
com.atlassian.sal.crowd.utils.TransactionHelper

public class TransactionHelper extends Object
Utilities for dealing with DB transactions.
  • Constructor Details

    • TransactionHelper

      public TransactionHelper(com.atlassian.sal.api.transaction.TransactionTemplate transactionTemplate)
  • Method Details

    • transactional

      public <T> T transactional(Class<T> serviceClass, T service)
      Wraps the given service creating a proxy, for which each method will be executed within a DB transaction.

      Needed because we can't use Spring transaction-related annotations and Spring bean wrappers in plugins.

      Parameters:
      serviceClass - interface of the service
      service - instance of the service