inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

실전! 스프링 데이터 JPA

초기 어플리케이션 기동이 오래 걸립니다.

576

jnj45

작성한 질문수 8

0

오라클과 mssql을 동시에 테스트하고 있습니다.

근데, 오라클을 연동하여 어플리케이션 기동할 때 너무 오래 걸립니다.

entity와 db 맵핑을 validation하는 과정에서 오래 거리는 듯합니다.

혹시 원인을 알 수 있을까요? (반면, mssql은 기동시간도 짧고, validation오류가 발생하더라도 빨리 발생합니다.)

오라클은 로컬에 18c express버전으로 설치되어 있고, jdbc jar파일은 오라클 홈에서 18버전에 맞는 걸로 다운 받았습니다.(ojdbc8.jar)

아래는 기동 시 오류로그 일부분입니다.

========================================================================================

INFO  20-09-02 17:33:12[restartedMain] [LogHelper:31] - HHH000204: Processing PersistenceUnitInfo [name: default]

INFO  20-09-02 17:33:13[restartedMain] [Version:44] - HHH000412: Hibernate ORM core version 5.4.12.Final

INFO  20-09-02 17:33:13[restartedMain] [Version:49] - HCANN000001: Hibernate Commons Annotations {5.1.0.Final}

INFO  20-09-02 17:33:13[restartedMain] [HikariDataSource:110] - HikariPool-1 - Starting...

INFO  20-09-02 17:33:13[restartedMain] [HikariDataSource:123] - HikariPool-1 - Start completed.

INFO  20-09-02 17:33:14[restartedMain] [Dialect:172] - HHH000400: Using dialect: org.hibernate.dialect.Oracle12cDialect

WARN  20-09-02 17:34:55[restartedMain] [AnnotationConfigServletWebServerApplicationContext:558] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [USE_YN] in table [EF_USER_VIEW]; found [char (Types#CHAR)], but expecting [varchar2(255 char) (Types#VARCHAR)]

INFO  20-09-02 17:34:55[restartedMain] [HikariDataSource:350] - HikariPool-1 - Shutdown initiated...

INFO  20-09-02 17:34:55[restartedMain] [HikariDataSource:352] - HikariPool-1 - Shutdown completed.

INFO  20-09-02 17:34:55[restartedMain] [StandardService:173] - Stopping service [Tomcat]

INFO  20-09-02 17:34:55[restartedMain] [ConditionEvaluationReportLoggingListener:136] - 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

ERROR 20-09-02 17:34:55[restartedMain] [SpringApplication:826] - Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [USE_YN] in table [EF_USER_VIEW]; found [char (Types#CHAR)], but expecting [varchar2(255 char) (Types#VARCHAR)]

================================================================

spring-boot java spring JPA

답변 1

0

김영한

안녕하세요. jnj45님

정확한 원인은 저도 잘 모르겠습니다.

entity와 db 맵핑을 validation하는 과정은 빼시는 것을 권장드립니다.

-> DB 스키마 조회 권한이 없는데 계속 조회해서 문제가 발생한 것일 수도 있습니다.

실제로 운영을 하다보면 DB 스키마와 JPA를 딱 맞추지 못하고 (예를 들어서 DB에 컬럼을 먼저 추가하고, 이후에 JPA 컬럼을 추가한다거나) 운영하는 타이밍들이 있어서 validation은 빼시는 것을 추천합니다.

감사합니다.

existsByUserIdAndProjectId vs existsByUserAndProject 중 어떤 방식이 적절할까요?

0

67

1

existsByUserIdAndProjectId vs existsByUserAndProject 중 어떤 방식이 적절할까요?

0

103

3

MemberRepository 구현체

0

56

1

pdf 표현 질문드립니다.

0

60

1

로그가 남지 않는 문제.

0

79

1

테스트 라이브러리가 강의는 junit4가 맞나요??

0

68

2

pdf 파일과 차이점이 있는 것같은데 문제 없나요?

0

71

2

@PrePersist, @PreUpdate 호출 시점 질문드립니다.

0

91

2

Sort 인터페이스는 잘 사용 안하나요?

0

52

1

스캔대상 질문드립니다.

0

45

1

하이버네이트6에서의 최적화에 이은 질문

0

82

1

save() vs saveAndFlush DB 통신 횟수

0

51

1

순수 JPA 리포지토리 코드 수정부분

0

85

2

bulk연산 후 flush하는 이유를 모르겠어요

0

150

3

bulk insert 질문입니다.

0

174

2

교만했던 것 같아요.

0

145

1

RESTful 강의는 안하시는 건지 궁금합니다.

0

145

2

동적 테이블에 대한 질문

0

85

1

영속성 전이와 연관관계

0

130

2

강의 10:25 질문

0

73

1

단건 update 질문

0

95

2

엔티티 와 도메인의 경계

0

126

1

UsernameOnlyDto 타입 type mismatch 오류

0

119

1

Projection 개념과 데이터 전달과정에 대해 질문 있습니다.

0

135

1