• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    해결됨

영속성 컨텍스트가, 영속성 컨텍스트인 이유

21.09.08 17:21 작성 조회수 153

1

제가 약간 단어가 확 와닿지 않으면 파보는 성향이 있어서 ㅠㅠ 질문드립니다.

 

검색해보니까 영속성은 영어로 persistence이고,

 

the continuance of an effect after its cause is removed

 

또는 to Store Permanently

 

라는 의미로 쓰인다고 되어있더라구요.

 

흠,, 그래서 제가 추측하기로는

 

persistance context의 의미는

 

객체가 db에 영속적으로 저장되까지의 징검다리 역할을 하니까,

persistence context 일까요?

 

 

(context가 약간, 정적인 상태느낌보다는 어디서 어디로 향하는 동적인 느낌이므로?)

 

 
 

답변 2

·

답변을 작성해보세요.

1

David님의 프로필

David

2021.09.08

안녕하세요. 따라란따라란님, 공식 서포터즈 David입니다.

.

https://docs.oracle.com/javaee/7/api/javax/persistence/EntityManager.html

위 링크에 보시면 Persistence Context에 대해 아래와 같이 설명하고 있습니다.

"A persistence context is a set of entity instances in which for any persistent entity identity there is a unique entity instance."

이 링크의 채택된 답변도 도움이 되실 것 같습니다.

https://stackoverflow.com/questions/19930152/what-is-persistence-context

이와 별개로 저는 Persistence Context를 "영속화와 관련된 것들을 처리하는 환경"으로 이해하고 있습니다.

.
감사합니다.

넵 답변 감사합니다.

그런데 제가 궁금한것은, 왜 하필 이름이 persistence context이냐 입니다.

 

예를 들어 set of unique entities라고도 할 수도 있고, 여러 다른 표현들이 있을수도 있을것 같은데,

 

persistence context라는 말의 의미가 정확히 안와닿아서요.

David님의 프로필

David

2021.09.08

Persistence Context가 어떤 기능을 하는지에 대해 알게 되시면 더 와닿을 듯합니다.

1

자바 공식문서에도

 
 

Java Persistence API

The Java Persistence API (JPA) is a Java standards-based solution for persistence. Persistence uses an object/relational mapping approach to bridge the gap between an object-oriented model and a relational database. The Java Persistence API can also be used in Java SE applications, outside of the Java EE environment. Java Persistence consists of the following areas:

 

라고되어있네요