inflearn logo
Course

Course

Instructor

seungyun93930553's Posts

seungyun93930553 seungyun93930553

@seungyun93930553

Reviews Written
-
Average Rating
-

Posts 1

Q&A

OSIV false 일때 영속성 관련해서 질문드립니다.

로그로 쿼리를 찍어봐도 save 호출하는 메소드는 select 밖에 안날라가고있더라구요.. 뭐를 놓치고있는건가요? import org . springframework . transaction . annotation . Transactional ; @ Service @ Transactional ( readOnly = true ) @ RequiredArgsConstructor public class service { ... @ Transactional public Entity insert ( String id ) { DTO dto = new DTO (); dto . setId ( id ); Entity entity = repository . save ( Entity . create ( dto )); log.debug("entity {}", entity); //여기서는 엔티티가 정상적으로 찍힙니다. return entity ; // 그렇다면 return이 되고난뒤에 트랜잭션이 종료되니 insert문이 나가야하는거 아닌가요?.. } } save말고 saveAndFlush를 사용하면.. no transaction is in progress 라고 오류가나오는데.. 왜.. @Transactional 안 메소드에서 이런에러가 생기는지..

Likes
0
Comments
2
Viewcount
467