• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

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

20.09.02 17:43 작성 조회수 474

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)]

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

답변 1

답변을 작성해보세요.

0

안녕하세요. jnj45님

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

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

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

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

감사합니다.