본문 바로가기
Spring/DB연동

@Transactional , JPA , SimpleJpaRepository

by doriver 2025. 4. 15.

 

SimpleJpaRepository

 * Default implementation of the {@link org.springframework.data.repository.CrudRepository} interface. This will offer you a more sophisticated interface than the plain {@link EntityManager} .

SimpleJpaRepository를 확인해 보면

@Transactional 어노테이션이 적용되어 있는 것을 알 수 있다.

SimpleJpaRepository 클래스 전역에 @Transactional(readOnly = true)가 설정되어 findById는 읽기 전용으로 동작

 

 

 

 

https://yoonseon.tistory.com/167

 

@Tracsactional 없이 save()가 동작한다?

개요최근 코드리뷰를 하게 되던 중, 비즈니스 로직에 @Transactional 어노테이션이 누락되어 있는 코드를 보게 되었습니다. 저는 매번 Service를 구현할 때 외부에서 호출하는 public 메인 비즈니스 로

yoonseon.tistory.com

 

'Spring > DB연동' 카테고리의 다른 글

트랜잭션 범위의 PersistenceContext  (0) 2025.04.20
@Transactional 붙은 메소드  (0) 2025.04.15
JPA 즉시로딩(EAGER), 지연로딩(LAZY)  (0) 2025.04.02
JPA기본( EntityManager, PersistenceContext )  (0) 2025.04.02
jpa에서 update  (0) 2025.03.29