org.springframework.dao.InvalidDataAccessApiUsageException: Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException: Executing an update/delete query
@Transactional 추가해주시면 해결됩니다.
예시
import org.springframework.transaction.annotation.Transactional;
...
@Transactional
public void update(User user) {
userRepository.save(user);
}
728x90
'Framework > Spring' 카테고리의 다른 글
[Spring] 엑셀 데이터 검증 ( Excel Data Validation ) (2) | 2023.06.15 |
---|---|
[Spring] MySQL 연동 (JPA, application.properties) (0) | 2023.06.02 |
[Spring] org.thymeleaf.exceptions.TemplateInputException (0) | 2023.05.25 |
[Spring] Web Project 시작하기 STEP 1 (0) | 2023.05.15 |
[Spring] 트랜잭션 전파 규칙 (Transaction Propagation Behaviors) (0) | 2023.04.21 |
댓글