Preloader image
DDD

데이터베이스

@Transactional - Connection is read-only. Queries leading to data modification are not allowed

작성자 관리자 (admin)
조회수 645
입력일 2019-11-09 23:19:58

@Transactional 의 위치는 어디에 두어야 하는가?
Spring의 Contrller or Service or ServiceImpl or Mapper 어디든 두어도 적용이 된다.
단, 특정 Method에만 적용하려면 Service or ServiceImpl or Mapper의 해당 class 상단에 두어야한다.

@Transactional(readOnly = true, propagation = Propagation.REQUIRED, rollbackFor={Exception.class})
public class process_start()
{
  // **
}

^