Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- JPA
- IntelliJ
- 자바
- SQL
- Javascript
- 티스토리챌린지
- MariaDB
- 오블완
- spring
- MongoDB
- PostgreSQL
- 호이스팅
- DBMS
- rsync
- group by
- git
- top
- 인터페이스
- java
- 명령어
- oracle
- mssql
- analytics4
- mysql
- 리눅스
- docker
- 추상클래스
- 트랜잭션
- Linux
- 차이점
Archives
- Today
- Total
목록2024/10/09 (1)
hanker
Spring Error - jakarta.persistence.TransactionRequiredException: No EntityManager with actual transaction available for current thread - cannot reliably process 'persist' call
해당 오류 원인은 JPA 사용 시 트랜잭션 없이 엔티티를 영속화하려고 할 경우에 발생한다. 해결방법은 간단한데, EntityManager를 사용하는 클래스 상단에 @Transactional 어노테이션을 추가하던, persist를 사용하는 메서드에 @Transactional 어노테이션을 추가하면 된다. @Transactionalpublic class JpaMemberRepository implements MemberRepository { private final EntityManager em; public JpaMemberRepository(EntityManager em) { this.em = em; } @Override // @Transactional publ..
SPRING/SPRING-ERROR
2024. 10. 9. 13:52