작성
·
535
0
안녕하세요, 영한님 강의 잘 듣고있습니다. JPA에 대해서 잘 알려주셔서 감사합니다.
따라하다가 오류가 생겨서 말인데요
문제
JpaMain.class를 실행하니까 이런 오류로그가 떳습니다.
WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)
Feb 06, 2021 9:27:37 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001005: using driver [org.h2.Driver] at URL [jdbc:h2:tcp://localhost/~/test]
Feb 06, 2021 9:27:37 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001001: Connection properties: {user=sa}
Feb 06, 2021 9:27:37 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001003: Autocommit mode: false
Feb 06, 2021 9:27:37 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections <init>
INFO: HHH000115: Hibernate connection pool size: 20 (min=1)
Feb 06, 2021 9:27:37 AM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
Exception in thread "main" javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: hellojpa.Member
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:807)
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:785)
at hellojpa.JpaMain.main(JpaMain.java:24)
Caused by: org.hibernate.PersistentObjectException: detached entity passed to persist: hellojpa.Member
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:127)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:62)
at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:800)
... 2 more
해본것
1. pom.xml에 라이브러리 잘 추가되었는지 확인
2. persistence-unit name 제대로 되었나 확인
하지만 여전히 문제점은 잘 모르겠습니다. ㅠㅠ