java.lang.Object
com.atlassian.confluence.security.denormalisedpermissions.impl.manage.DenormalisedLockService
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean

public class DenormalisedLockService extends Object implements org.springframework.beans.factory.DisposableBean
Allows to acquire DB locks. Could be useful to prevent parallel execution.
Since:
7.11.0
  • Constructor Details

    • DenormalisedLockService

      public DenormalisedLockService(com.atlassian.event.api.EventPublisher eventPublisher, org.hibernate.SessionFactory sessionFactory, org.springframework.transaction.PlatformTransactionManager transactionManager)
  • Method Details

    • init

      @PostConstruct public void init()
    • acquireLockForTransaction

      public void acquireLockForTransaction(DenormalisedLockService.LockName lockName)
      Acquires the lock. Must be called from an existing transaction. Released automatically when the transaction finishes
      Parameters:
      lockName - the name of the lock
    • getRecord

    • onApplicationStarted

      @EventListener public void onApplicationStarted(ApplicationStartedEvent applicationStartedEvent)
    • destroy

      public void destroy() throws Exception
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      Throws:
      Exception