티스토리 뷰
org.springframework.web.util.NestedServletException: Request
processing failed; nested exception is
org.springframework.dao.InvalidDataAccessApiUsageException: No
EntityManager with actual transaction available for current thread -
cannot reliably process 'remove' call; nested exception is
javax.persistence.TransactionRequiredException: No EntityManager with
actual transaction available for current thread - cannot reliably
process 'remove' call
org.springframework.dao.InvalidDataAccessApiUsageException:
No EntityManager with actual transaction available for current thread -
cannot reliably process 'remove' call; nested exception is
javax.persistence.TransactionRequiredException: No EntityManager with
actual transaction available for current thread - cannot reliably
process 'remove' call
javax.persistence.TransactionRequiredException: No EntityManager with actual transaction available for current thread - cannot reliably process 'remove' call
Spring JPA @Repository에서 deleteByName을 사용하려고 하는데 오류가 발생하였다. Spring-data-jpa 1.7.x 이상 부터 deleteBy 또는 removeBy를 이용한 delete 쿼리를 사용할 수 있고 기존에 잘 사용하고 있었다.
해결방법은 메소드 위에 @Transactional 명시해 주면 끝...
기존에는 @Service 메소드에서 @Transactional 어노테이션을 명시해 놓은 클래스를 상속받아 사용하였기 때문에 오류가 발생되지 않았던 것이다.
Spring Data: “delete by” is supported?
Spring Data JPA - Reference Documentation -> 3.1. Core concepts
'개발 이야기 > Exception' 카테고리의 다른 글
org.hibernate.validator.internal.engine.ConfigurationImpl.getDefaultParameterNameProvider (0) | 2017.06.16 |
---|---|
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! (0) | 2016.05.09 |
Unavailable authority factory: European Petroleum Survey Group (0) | 2016.02.16 |
UnsupportedClassVersionError (0) | 2016.02.16 |
NoSuchMethodError: PGSimpleDataSource (0) | 2016.02.15 |
- Total
- Today
- Yesterday
- 13억분의1의남자
- NestedServletException
- TransactionRequiredException
- epsg
- ubuntu
- psqlexception
- Geoserver
- tomcat
- postgres
- exception
- PGSimpleDataSource
- java
- InvalidDataAccessApiUsageException
- openjdk
- ppa:webupd8team
- known_hosts
- spring-data-jpa
- React.js
- ds_store
- geotools
- OSX
- React
- 야마송
- update-alternatives
- 14.04
- PostgreSQL
- Postgis
- 첫사랑의 강
- JPA
- 손지우
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |