commit

· Spring
스프링은 @Transactional 애노테이션을 이용해서 트랜잭션을 처리하기 위해 내부적으로 AOP를 사용합니다. 실제로 @Transactional 애노테이션을 적용하기 위해 @EnableTransaction Management 태그를 사용하면 스프링은 @Transactional 애노테이션이 적용된 빈 객체를 찾아서 알맞은 프록시 객체를 생성합니다. ChangePasswordService package spring; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; public class ChangePasswordService ..
· JPA
JPA에서 핵심적인 내용은 다음과 같다. 객체와 관계형 데이터베이스 매핑(ORM, Object Relational Mapping) 영속성 컨텍스트 우선, 영속성 컨텍스트에 대해 알아보자. 엔티티 매니저와 팩토리와 엔티티 매니저 먼저, 웹 애플리케이션에서 EntityManagerFactory와 EntityManager의 간단한 동작을 살펴보았다. 클라이언트 요청을 받으면 EntityManagerFactory는 각 클라이언트에게 EntityManager를 부여한다. 각 클라이언트는 부여받은 EntityManager를 가지고 DB에 접근한다. 영속성 컨텍스트 JPA를 이해하는데 가장 핵심적이며, "엔티티를 영구 저장하는 환경"이라는 뜻을 가지고 있다. 실제 코드에서는 EntityManager.persists(..
runnnerDevHong
'commit' 태그의 글 목록