error: java.util.concurrent.ExecutionException: org.springframework.dao.InvalidDataAccessApiUsageException: no transaction is in progress; nested exception is javax.persistence.TransactionRequiredException: no transaction is in progress

비동기로 동작하는 메서드 내에서 트랜잭션을 적용하기 위해 특정 작업에 대해서만 메서드로 분리하고 @Transactional 을 분리한 메서드에 적용해주고 비동기 메서드 내에서 분리한 메서드를 사용했다.

그런데 위와 같이 트랜잭션이 없다는 에러가 발생했다.

트랜잭션을 적용한 메서드를 같은 클래스 내에서 사용할 때 AOP가 감지를 하지 못해서 트랜잭션이 적용되지 않았던 것이었다.

@Transactional 을 사용한 메서드를 다른 클래스로 따로 빼서 적용하니 해결되었다.