엔티티를 지속적으로 저장하고 있는 속성을 영속성 컨텍스트 라고 말할 수 있다. JPA에서는 기본적으로 EntityManagerFactory객체를 이용해서 EntityManager객체를 생성하고,이 EntityManager객체의 메서드를 이용해서 조회, 저장, 변경, 삭제의 작업을 수행한다. 영속성 컨텍스트는 눈으로 확인 할 수는 없지만, EntityManager를 생성할 때 같이 만들어지고 EntityManager를 닫을 때 사라진다. Entity에는 다음과 같은 상태가 존재한다. ▶ 비영속@Entity로 지정한 객체를 생성했을 뿐 EntityManager를 사용하고 있지 않은 상태이다. ▶ 영속영속성 컨텍스트가 엔티티를 관리할 수 있는 상태를 '영속' 상태라 한다.EntityManager의 persis..
1. pom.xml dependency org.springframework.data spring-data-jpa 1.2.0.RELEASE org.hibernate.javax.persistence hibernate-jpa-2.0-api 1.0.1.Final org.hibernate hibernate-core 4.1.9.Final org.hibernate hibernate-entitymanager 4.1.9.Final org.hibernate hibernate-ehcache 4.1.9.Final com.jolbox bonecp 0.7.1.RELEASE mysql mysql-connector-java 5.1.22 runtime 2. dao-context.xml hibernate.cache.use_second_..