Showing posts with the label EntityManager

Stop Using @Autowired for EntityManager: The Hidden Dangers of Spring JPA

I magine this scenario: Your application works perfectly in the staging environment. The unit tests pass with flying colors. But the moment you deploy to production and the user traffic spikes, thin…
Stop Using @Autowired for EntityManager: The Hidden Dangers of Spring JPA

스프링 JPA: EntityManager가 스레드 안전한 이유? @PersistenceContext의 마법

동시성 이슈로 밤새 디버깅을 해본 경험, 백엔드 개발자라면 한 번쯤 있으실 겁니다. 특히 스프링(Spring)과 JPA를 다룰 때 가장 의아한 지점이 하나 있습니다. "EntityManager는 스레드에 안전하지 않다(Thread-unsafe)고 배웠는데, 왜 우리는 싱글톤인 Service나 Repository 빈에서 아무렇지 않게 주입받아 …
스프링 JPA: EntityManager가 스레드 안전한 이유? @PersistenceContext의 마법
OlderHomeNewest