• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

안녕하세요

21.09.03 16:34 작성 조회수 156

0

안녕하세요. 강의 잘 듣고 있습니다.

다름이 아니라, 상품을 등록하고 상품 목록에서 새로운 상품을 등록한 것을 새롭게 갱신 해야되는데 갱신이 안돼서 질문드립니다. log를 통해서 form을 찍었는데도 데이터가 저장되지 않습니다. 굉장히 기본적인거에서 틀린거 같은데 잘 안보이네요.. 일단 첫번째 사진은 갱신이 되지 않고 계속 저렇게 목록이 뜹니다.

C:\Users\조원형\.jdks\openjdk-16.0.1\bin\java.exe "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.1.2\lib\idea_rt.jar=62082:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.1.2\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\조원형\study\jpashop\out\production\classes;C:\Users\조원형\study\jpashop\out\production\resources;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-data-jpa\2.5.4\61bdc9ccd2dd88dc956d85b4a608ef624476db7d\spring-boot-starter-data-jpa-2.5.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-thymeleaf\2.5.4\cade32e2891268e53f710d2e95671dff03de23b5\spring-boot-starter-thymeleaf-2.5.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-web\2.5.4\2bef2cedf2e0d1038ab51a2c6154579c5945e60c\spring-boot-starter-web-2.5.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-devtools\2.5.4\106fbf3e6e7265efbcc3942c2d65f0ce1abf3889\spring-boot-devtools-2.5.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-validation\2.5.4\8acfe1b2d2a111e278ee92f10d809dd1e63a7381\spring-boot-starter-validation-2.5.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\com.github.gavlyukovskiy\p6spy-spring-boot-starter\1.5.6\495579c7fb01b005f19ec4d5188245c66de0937b\p6spy-spring-boot-starter-1.5.6.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\junit\junit\4.13.1\cdd00374f1fee76b11e2a9d127405aa3f6be5b6a\junit-4.13.1.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-aop\2.5.4\6a158adb640effb8153c7531f5ceb69f8fe2d025\spring-boot-starter-aop-2.5.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-jdbc\2.5.4\ce13933bc6b2ce6789288407c9244a104c9af6ed\spring-boot-starter-jdbc-2.5.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\jakarta.transaction\jakarta.transaction-api\1.3.3\c4179d48720a1e87202115fbed6089bdc4195405\jakarta.transaction-api-1.3.3.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\jakarta.persistence\jakarta.persistence-api\2.2.3\8f6ea5daedc614f07a3654a455660145286f024e\jakarta.persistence-api-2.2.3.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.hibernate\hibernate-core\5.4.32.Final\99a5e10bf455337014c190e141ec631e9ff71663\hibernate-core-5.4.32.Final.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-jpa\2.5.4\91fb0dcb66a316bb65e9b837757f105c4bf1359d\spring-data-jpa-2.5.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aspects\5.3.9\ee2c3f8f99e1f115f502a7e47e632b1ed229e766\spring-aspects-5.3.9.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter\2.5.4\d5028e89214b204e39e5920ae118d69293ac3d8a\spring-boot-starter-2.5.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.thymeleaf\thymeleaf-spring5\3.0.12.RELEASE\aa640b214411978a23cbe271c3fb9569d1bda608\thymeleaf-spring5-3.0.12.RELEASE.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.thymeleaf.extras\thymeleaf-extras-java8time\3.0.4.RELEASE\36e7175ddce36c486fff4578b5af7bb32f54f5df\thymeleaf-extras-java8time-3.0.4.RELEASE.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-json\2.5.4\6bf89f94c5d2455689d8649a3ead440d05e0c8f7\spring-boot-starter-json-2.5.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-tomcat\2.5.4\57c1254fe8630619f17ff0ed37d4ffdfd0528c20\spring-boot-starter-tomcat-2.5.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework\spring-webmvc\5.3.9\c3cd1f0bba2658995e887d2f0011ab9bd3da1773\spring-webmvc-5.3.9.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework\spring-web\5.3.9\88c920ec1bda67fea04daa8e16165777440df473\spring-web-5.3.9.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-autoconfigure\2.5.4\3fe555faa956fa8b63b0d0115bb0ed55e4509b5e\spring-boot-autoconfigure-2.5.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot\2.5.4\b8d09303fa30f5102f33bcf2fa64b66be8fa39ba\spring-boot-2.5.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-el\9.0.52\ee51a2bab9b9c055f857fef0926116e8f459e8cc\tomcat-embed-el-9.0.52.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.hibernate.validator\hibernate-validator\6.2.0.Final\d6b0760dfffbf379cedd02f715ff4c9a2e215921\hibernate-validator-6.2.0.Final.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\com.github.gavlyukovskiy\datasource-decorator-spring-boot-autoconfigure\1.5.6\cac386fe9df77870133594f054ee32e5d08ab93d\datasource-decorator-spring-boot-autoconfigure-1.5.6.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\p6spy\p6spy\3.8.2\52299d9a1ec2bc2fb8b1a21cc12dfc1a7c033caf\p6spy-3.8.2.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.hamcrest\hamcrest-core\2.2\3f2bd07716a31c395e2837254f37f21f0f0ab24b\hamcrest-core-2.2.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aop\5.3.9\9bcad31a74e60d205500dd67d2220bd0195c63f8\spring-aop-5.3.9.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.aspectj\aspectjweaver\1.9.7\158f5c255cd3e4408e795b79f7c3fbae9b53b7ca\aspectjweaver-1.9.7.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\com.zaxxer\HikariCP\4.0.3\107cbdf0db6780a065f895ae9d8fbf3bb0e1c21f\HikariCP-4.0.3.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jdbc\5.3.9\18efdbd53c154a08e1854a6cff29c2becea04025\spring-jdbc-5.3.9.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.hibernate.common\hibernate-commons-annotations\5.1.2.Final\e59ffdbc6ad09eeb33507b39ffcf287679a498c8\hibernate-commons-annotations-5.1.2.Final.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.jboss.logging\jboss-logging\3.4.2.Final\e517b8a93dd9962ed5481345e4d262fdd47c4217\jboss-logging-3.4.2.Final.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.javassist\javassist\3.27.0-GA\f63e6aa899e15eca8fdaa402a79af4c417252213\javassist-3.27.0-GA.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy\1.10.22\ef45d7e2cd1c600d279704f492ed5ce2ceb6cdb5\byte-buddy-1.10.22.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\antlr\antlr\2.7.7\83cd2cd674a217ade95a4bb83a8a14f351f48bd0\antlr-2.7.7.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.jboss\jandex\2.2.3.Final\d3865101f0666b63586683bd811d754517f331ab\jandex-2.2.3.Final.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\com.fasterxml\classmate\1.5.1\3fe0bed568c62df5e89f4f174c101eab25345b6c\classmate-1.5.1.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.dom4j\dom4j\2.1.3\a75914155a9f5808963170ec20653668a2ffd2fd\dom4j-2.1.3.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-runtime\2.3.5\a169a961a2bb9ac69517ec1005e451becf5cdfab\jaxb-runtime-2.3.5.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context\5.3.9\887f4579ade4f47cf0102856f4f4c88eda8ec9d7\spring-context-5.3.9.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework\spring-orm\5.3.9\db37587efd6525283b53c7adc8989095e9eabc27\spring-orm-5.3.9.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-commons\2.5.4\7e5f9c80ff9a38ee0aaba645600acfe7de1a9803\spring-data-commons-2.5.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework\spring-tx\5.3.9\a7057cf30368d014a1c8e5880a128703c890ec79\spring-tx-5.3.9.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework\spring-beans\5.3.9\48600db2cb1abc0f7ef2b073f0c1abd78a83bcfc\spring-beans-5.3.9.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework\spring-core\5.3.9\cfef19d1dfa41d56f8de66238dc015334997d573\spring-core-5.3.9.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api\1.7.32\cdcff33940d9f2de763bc41ea05a0be5941176c3\slf4j-api-1.7.32.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-logging\2.5.4\bef5da8f5610ca83dcefead706d66be09b9ef55d\spring-boot-starter-logging-2.5.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\jakarta.annotation\jakarta.annotation-api\1.3.5\59eb84ee0d616332ff44aba065f3888cf002cd2d\jakarta.annotation-api-1.3.5.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.yaml\snakeyaml\1.28\7cae037c3014350c923776548e71c9feb7a69259\snakeyaml-1.28.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.thymeleaf\thymeleaf\3.0.12.RELEASE\de1865b0d58590a50c33900115a293335dd8ef25\thymeleaf-3.0.12.RELEASE.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jdk8\2.12.4\858a1e1b677cbafd3b100d5154f491a7051401c\jackson-datatype-jdk8-2.12.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jsr310\2.12.4\b1174c05d4ded121a7eaeed3f148709f9585b981\jackson-datatype-jsr310-2.12.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.module\jackson-module-parameter-names\2.12.4\87c4e9a3302f0fafe4e5587f9c27d22847d8fe00\jackson-module-parameter-names-2.12.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.12.4\69206e02e6a696034f06a59d3ddbfbba5a4cd81\jackson-databind-2.12.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-websocket\9.0.52\557c15720af6f8d59a8308ce290f4408b5325194\tomcat-embed-websocket-9.0.52.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-core\9.0.52\501d876042f7bff64ee42cf1849e4abea272632\tomcat-embed-core-9.0.52.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework\spring-expression\5.3.9\f5ca763cfb9d62d196efd5d25e8daca7d555ed75\spring-expression-5.3.9.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\jakarta.validation\jakarta.validation-api\2.0.2\5eacc6522521f7eacb081f95cee1e231648461e7\jakarta.validation-api-2.0.2.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.hamcrest\hamcrest\2.2\1820c0968dba3a11a1b30669bb1f01978a91dedc\hamcrest-2.2.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\jakarta.xml.bind\jakarta.xml.bind-api\2.3.3\48e3b9cfc10752fba3521d6511f4165bea951801\jakarta.xml.bind-api-2.3.3.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\txw2\2.3.5\ec8930fa62e7b1758b1664d135f50c7abe86a4a3\txw2-2.3.5.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\com.sun.istack\istack-commons-runtime\3.0.12\cbbe1a62b0cc6c85972e99d52aaee350153dc530\istack-commons-runtime-3.0.12.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jcl\5.3.9\622eb12c98768b6d3acc71ce06bac8b332607a10\spring-jcl-5.3.9.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.2.5\30e0c3932f24fb10e7851dd308a3ad14e570d60\logback-classic-1.2.5.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-to-slf4j\2.14.1\ce8a86a3f50a4304749828ce68e7478cafbc8039\log4j-to-slf4j-2.14.1.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.slf4j\jul-to-slf4j\1.7.32\8a055c04ab44e8e8326901cadf89080721348bdb\jul-to-slf4j-1.7.32.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.attoparser\attoparser\2.0.5.RELEASE\a93ad36df9560de3a5312c1d14f69d938099fa64\attoparser-2.0.5.RELEASE.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.unbescape\unbescape\1.1.6.RELEASE\7b90360afb2b860e09e8347112800d12c12b2a13\unbescape-1.1.6.RELEASE.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.12.4\6a1bd259b6c4e3f9219ec8ec0be55ed11eed0c\jackson-core-2.12.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\2.12.4\752cf9a2562ac2c012e48057e3a4c17dad66c66e\jackson-annotations-2.12.4.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-core\1.2.5\3e149d9c476be313030faf12d76a82c8a0e97f04\logback-core-1.2.5.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-api\2.14.1\cd8858fbbde69f46bce8db1152c18a43328aae78\log4j-api-2.14.1.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\com.h2database\h2\1.4.200\f7533fe7cb8e99c87a43d325a77b4b678ad9031a\h2-1.4.200.jar;C:\Users\조원형\.gradle\caches\modules-2\files-2.1\com.sun.activation\jakarta.activation\1.2.2\74548703f9851017ce2f556066659438019e7eb5\jakarta.activation-1.2.2.jar jpabook.jpashop.JpashopApplication

  .   ____          _            __ _ _

 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \

( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \

 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )

  '  |____| .__|_| |_|_| |_\__, | / / / /

 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v2.5.4)

2021-09-03 16:27:50.547  INFO 19308 --- [  restartedMain] jpabook.jpashop.JpashopApplication       : Starting JpashopApplication using Java 16.0.1 on DESKTOP-6TCCPCI with PID 19308 (C:\Users\조원형\study\jpashop\out\production\classes started by 조원형 in C:\Users\조원형\study\jpashop)

2021-09-03 16:27:50.552  INFO 19308 --- [  restartedMain] jpabook.jpashop.JpashopApplication       : No active profile set, falling back to default profiles: default

2021-09-03 16:27:50.640  INFO 19308 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable

2021-09-03 16:27:50.641  INFO 19308 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'

2021-09-03 16:27:52.238  INFO 19308 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.

2021-09-03 16:27:52.311  INFO 19308 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 31 ms. Found 0 JPA repository interfaces.

2021-09-03 16:27:53.657  INFO 19308 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)

2021-09-03 16:27:53.680  INFO 19308 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]

2021-09-03 16:27:53.681  INFO 19308 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.52]

2021-09-03 16:27:53.826  INFO 19308 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext

2021-09-03 16:27:53.826  INFO 19308 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3183 ms

2021-09-03 16:27:54.153  INFO 19308 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...

2021-09-03 16:27:54.280  INFO 19308 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.

2021-09-03 16:27:54.299  INFO 19308 --- [  restartedMain] o.s.b.a.h2.H2ConsoleAutoConfiguration    : H2 console available at '/h2-console'. Database available at 'jdbc:h2:tcp://localhost/~/jpashop'

2021-09-03 16:27:54.676  INFO 19308 --- [  restartedMain] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]

2021-09-03 16:27:54.827  INFO 19308 --- [  restartedMain] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.4.32.Final

2021-09-03 16:27:55.075  INFO 19308 --- [  restartedMain] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}

2021-09-03 16:27:55.311  INFO 19308 --- [  restartedMain] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect

2021-09-03 16:27:56.237 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : drop table if exists category CASCADE 

2021-09-03 16:27:56.241  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076240 | took 1ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop table if exists category CASCADE 

drop table if exists category CASCADE ;

2021-09-03 16:27:56.241 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : drop table if exists category_item CASCADE 

2021-09-03 16:27:56.242  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076242 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop table if exists category_item CASCADE 

drop table if exists category_item CASCADE ;

2021-09-03 16:27:56.242 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : drop table if exists delivery CASCADE 

2021-09-03 16:27:56.243  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076243 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop table if exists delivery CASCADE 

drop table if exists delivery CASCADE ;

2021-09-03 16:27:56.243 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : drop table if exists item CASCADE 

2021-09-03 16:27:56.244  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076244 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop table if exists item CASCADE 

drop table if exists item CASCADE ;

2021-09-03 16:27:56.244 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : drop table if exists member CASCADE 

2021-09-03 16:27:56.245  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076245 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop table if exists member CASCADE 

drop table if exists member CASCADE ;

2021-09-03 16:27:56.245 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : drop table if exists order_item CASCADE 

2021-09-03 16:27:56.246  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076246 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop table if exists order_item CASCADE 

drop table if exists order_item CASCADE ;

2021-09-03 16:27:56.246 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : drop table if exists orders CASCADE 

2021-09-03 16:27:56.247  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076247 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop table if exists orders CASCADE 

drop table if exists orders CASCADE ;

2021-09-03 16:27:56.247 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : drop sequence if exists hibernate_sequence

2021-09-03 16:27:56.248  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076248 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop sequence if exists hibernate_sequence

drop sequence if exists hibernate_sequence;

2021-09-03 16:27:56.251 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : create sequence hibernate_sequence start with 1 increment by 1

2021-09-03 16:27:56.253  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076253 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create sequence hibernate_sequence start with 1 increment by 1

create sequence hibernate_sequence start with 1 increment by 1;

2021-09-03 16:27:56.254 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : create table category (category_id bigint not null, name varchar(255), parent_id bigint, primary key (category_id))

2021-09-03 16:27:56.255  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076255 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create table category (category_id bigint not null, name varchar(255), parent_id bigint, primary key (category_id))

create table category (category_id bigint not null, name varchar(255), parent_id bigint, primary key (category_id));

2021-09-03 16:27:56.256 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : create table category_item (category_id bigint not null, item_id bigint not null)

2021-09-03 16:27:56.257  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076257 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create table category_item (category_id bigint not null, item_id bigint not null)

create table category_item (category_id bigint not null, item_id bigint not null);

2021-09-03 16:27:56.257 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : create table delivery (delivery_id bigint not null, city varchar(255), street varchar(255), zipcode varchar(255), status varchar(255), primary key (delivery_id))

2021-09-03 16:27:56.258  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076258 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create table delivery (delivery_id bigint not null, city varchar(255), street varchar(255), zipcode varchar(255), status varchar(255), primary key (delivery_id))

create table delivery (delivery_id bigint not null, city varchar(255), street varchar(255), zipcode varchar(255), status varchar(255), primary key (delivery_id));

2021-09-03 16:27:56.258 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : create table item (dtype varchar(31) not null, item_id bigint not null, name varchar(255), price integer not null, stock_quantity integer not null, artist varchar(255), etc varchar(255), author varchar(255), isbn varchar(255), actor varchar(255), director varchar(255), primary key (item_id))

2021-09-03 16:27:56.259  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076259 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create table item (dtype varchar(31) not null, item_id bigint not null, name varchar(255), price integer not null, stock_quantity integer not null, artist varchar(255), etc varchar(255), author varchar(255), isbn varchar(255), actor varchar(255), director varchar(255), primary key (item_id))

create table item (dtype varchar(31) not null, item_id bigint not null, name varchar(255), price integer not null, stock_quantity integer not null, artist varchar(255), etc varchar(255), author varchar(255), isbn varchar(255), actor varchar(255), director varchar(255), primary key (item_id));

2021-09-03 16:27:56.259 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : create table member (member_id bigint not null, city varchar(255), street varchar(255), zipcode varchar(255), name varchar(255), primary key (member_id))

2021-09-03 16:27:56.260  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076260 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create table member (member_id bigint not null, city varchar(255), street varchar(255), zipcode varchar(255), name varchar(255), primary key (member_id))

create table member (member_id bigint not null, city varchar(255), street varchar(255), zipcode varchar(255), name varchar(255), primary key (member_id));

2021-09-03 16:27:56.261 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : create table order_item (order_item_id bigint not null, count integer not null, order_price integer not null, item_id bigint, order_id bigint, primary key (order_item_id))

2021-09-03 16:27:56.262  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076262 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create table order_item (order_item_id bigint not null, count integer not null, order_price integer not null, item_id bigint, order_id bigint, primary key (order_item_id))

create table order_item (order_item_id bigint not null, count integer not null, order_price integer not null, item_id bigint, order_id bigint, primary key (order_item_id));

2021-09-03 16:27:56.263 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : create table orders (order_id bigint not null, order_date timestamp, status varchar(255), delivery_id bigint, member_id bigint, primary key (order_id))

2021-09-03 16:27:56.264  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076264 | took 1ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create table orders (order_id bigint not null, order_date timestamp, status varchar(255), delivery_id bigint, member_id bigint, primary key (order_id))

create table orders (order_id bigint not null, order_date timestamp, status varchar(255), delivery_id bigint, member_id bigint, primary key (order_id));

2021-09-03 16:27:56.265 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : alter table category add constraint FK2y94svpmqttx80mshyny85wqr foreign key (parent_id) references category

2021-09-03 16:27:56.266  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076266 | took 1ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

alter table category add constraint FK2y94svpmqttx80mshyny85wqr foreign key (parent_id) references category

alter table category add constraint FK2y94svpmqttx80mshyny85wqr foreign key (parent_id) references category;

2021-09-03 16:27:56.266 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : alter table category_item add constraint FKu8b4lwqutcdq3363gf6mlujq foreign key (item_id) references item

2021-09-03 16:27:56.268  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076268 | took 1ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

alter table category_item add constraint FKu8b4lwqutcdq3363gf6mlujq foreign key (item_id) references item

alter table category_item add constraint FKu8b4lwqutcdq3363gf6mlujq foreign key (item_id) references item;

2021-09-03 16:27:56.268 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : alter table category_item add constraint FKcq2n0opf5shyh84ex1fhukcbh foreign key (category_id) references category

2021-09-03 16:27:56.271  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076271 | took 2ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

alter table category_item add constraint FKcq2n0opf5shyh84ex1fhukcbh foreign key (category_id) references category

alter table category_item add constraint FKcq2n0opf5shyh84ex1fhukcbh foreign key (category_id) references category;

2021-09-03 16:27:56.271 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : alter table order_item add constraint FKija6hjjiit8dprnmvtvgdp6ru foreign key (item_id) references item

2021-09-03 16:27:56.273  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076273 | took 2ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

alter table order_item add constraint FKija6hjjiit8dprnmvtvgdp6ru foreign key (item_id) references item

alter table order_item add constraint FKija6hjjiit8dprnmvtvgdp6ru foreign key (item_id) references item;

2021-09-03 16:27:56.274 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : alter table order_item add constraint FKt4dc2r9nbvbujrljv3e23iibt foreign key (order_id) references orders

2021-09-03 16:27:56.275  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076275 | took 1ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

alter table order_item add constraint FKt4dc2r9nbvbujrljv3e23iibt foreign key (order_id) references orders

alter table order_item add constraint FKt4dc2r9nbvbujrljv3e23iibt foreign key (order_id) references orders;

2021-09-03 16:27:56.276 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : alter table orders add constraint FKtkrur7wg4d8ax0pwgo0vmy20c foreign key (delivery_id) references delivery

2021-09-03 16:27:56.278  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076278 | took 1ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

alter table orders add constraint FKtkrur7wg4d8ax0pwgo0vmy20c foreign key (delivery_id) references delivery

alter table orders add constraint FKtkrur7wg4d8ax0pwgo0vmy20c foreign key (delivery_id) references delivery;

2021-09-03 16:27:56.278 DEBUG 19308 --- [  restartedMain] org.hibernate.SQL                        : alter table orders add constraint FKpktxwhj3x9m4gth5ff6bkqgeb foreign key (member_id) references member

2021-09-03 16:27:56.280  INFO 19308 --- [  restartedMain] p6spy                                    : #1630654076280 | took 1ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

alter table orders add constraint FKpktxwhj3x9m4gth5ff6bkqgeb foreign key (member_id) references member

alter table orders add constraint FKpktxwhj3x9m4gth5ff6bkqgeb foreign key (member_id) references member;

2021-09-03 16:27:56.281  INFO 19308 --- [  restartedMain] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]

2021-09-03 16:27:56.291  INFO 19308 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'

2021-09-03 16:27:56.543  WARN 19308 --- [  restartedMain] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning

2021-09-03 16:27:56.944  INFO 19308 --- [  restartedMain] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page: class path resource [static/index.html]

2021-09-03 16:27:57.260  INFO 19308 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729

2021-09-03 16:27:57.363  INFO 19308 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''

2021-09-03 16:27:57.383  INFO 19308 --- [  restartedMain] jpabook.jpashop.JpashopApplication       : Started JpashopApplication in 7.709 seconds (JVM running for 8.667)

2021-09-03 16:28:00.462  INFO 19308 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'

2021-09-03 16:28:00.462  INFO 19308 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'

2021-09-03 16:28:00.464  INFO 19308 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 2 ms

2021-09-03 16:28:00.580  INFO 19308 --- [nio-8080-exec-1] j.jpashop.controller.HomeController      : home controller

2021-09-03 16:28:07.221 DEBUG 19308 --- [nio-8080-exec-7] org.hibernate.SQL                        : call next value for hibernate_sequence

2021-09-03 16:28:07.240  INFO 19308 --- [nio-8080-exec-7] p6spy                                    : #1630654087240 | took 7ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2021-09-03 16:28:07.282  INFO 19308 --- [nio-8080-exec-7] p6spy                                    : #1630654087282 | took 0ms | commit | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

;

2021-09-03 16:28:07.467 DEBUG 19308 --- [nio-8080-exec-8] org.hibernate.SQL                        : select item0_.item_id as item_id2_3_, item0_.name as name3_3_, item0_.price as price4_3_, item0_.stock_quantity as stock_qu5_3_, item0_.artist as artist6_3_, item0_.etc as etc7_3_, item0_.author as author8_3_, item0_.isbn as isbn9_3_, item0_.actor as actor10_3_, item0_.director as directo11_3_, item0_.dtype as dtype1_3_ from item item0_

2021-09-03 16:28:07.470  INFO 19308 --- [nio-8080-exec-8] p6spy                                    : #1630654087470 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

select item0_.item_id as item_id2_3_, item0_.name as name3_3_, item0_.price as price4_3_, item0_.stock_quantity as stock_qu5_3_, item0_.artist as artist6_3_, item0_.etc as etc7_3_, item0_.author as author8_3_, item0_.isbn as isbn9_3_, item0_.actor as actor10_3_, item0_.director as directo11_3_, item0_.dtype as dtype1_3_ from item item0_

select item0_.item_id as item_id2_3_, item0_.name as name3_3_, item0_.price as price4_3_, item0_.stock_quantity as stock_qu5_3_, item0_.artist as artist6_3_, item0_.etc as etc7_3_, item0_.author as author8_3_, item0_.isbn as isbn9_3_, item0_.actor as actor10_3_, item0_.director as directo11_3_, item0_.dtype as dtype1_3_ from item item0_;

2021-09-03 16:28:07.477  INFO 19308 --- [nio-8080-exec-8] p6spy                                    : #1630654087477 | took 0ms | commit | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

;

2021-09-03 16:28:08.785  INFO 19308 --- [nio-8080-exec-1] j.jpashop.controller.HomeController      : home controller

2021-09-03 16:28:29.532 DEBUG 19308 --- [nio-8080-exec-4] org.hibernate.SQL                        : select item0_.item_id as item_id2_3_, item0_.name as name3_3_, item0_.price as price4_3_, item0_.stock_quantity as stock_qu5_3_, item0_.artist as artist6_3_, item0_.etc as etc7_3_, item0_.author as author8_3_, item0_.isbn as isbn9_3_, item0_.actor as actor10_3_, item0_.director as directo11_3_, item0_.dtype as dtype1_3_ from item item0_

2021-09-03 16:28:29.534  INFO 19308 --- [nio-8080-exec-4] p6spy                                    : #1630654109534 | took 0ms | statement | connection 6| url jdbc:h2:tcp://localhost/~/jpashop

select item0_.item_id as item_id2_3_, item0_.name as name3_3_, item0_.price as price4_3_, item0_.stock_quantity as stock_qu5_3_, item0_.artist as artist6_3_, item0_.etc as etc7_3_, item0_.author as author8_3_, item0_.isbn as isbn9_3_, item0_.actor as actor10_3_, item0_.director as directo11_3_, item0_.dtype as dtype1_3_ from item item0_

select item0_.item_id as item_id2_3_, item0_.name as name3_3_, item0_.price as price4_3_, item0_.stock_quantity as stock_qu5_3_, item0_.artist as artist6_3_, item0_.etc as etc7_3_, item0_.author as author8_3_, item0_.isbn as isbn9_3_, item0_.actor as actor10_3_, item0_.director as directo11_3_, item0_.dtype as dtype1_3_ from item item0_;

2021-09-03 16:28:29.536  INFO 19308 --- [nio-8080-exec-4] p6spy                                    : #1630654109535 | took 0ms | commit | connection 6| url jdbc:h2:tcp://localhost/~/jpashop

;

2021-09-03 16:28:34.383  INFO 19308 --- [nio-8080-exec-7] j.jpashop.controller.HomeController      : home controller

2021-09-03 16:28:36.714 DEBUG 19308 --- [nio-8080-exec-3] org.hibernate.SQL                        : call next value for hibernate_sequence

2021-09-03 16:28:36.716  INFO 19308 --- [nio-8080-exec-3] p6spy                                    : #1630654116716 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2021-09-03 16:28:36.718  INFO 19308 --- [nio-8080-exec-3] p6spy                                    : #1630654116718 | took 0ms | commit | connection 7| url jdbc:h2:tcp://localhost/~/jpashop

;

2021-09-03 16:28:36.729 DEBUG 19308 --- [nio-8080-exec-4] org.hibernate.SQL                        : select item0_.item_id as item_id2_3_, item0_.name as name3_3_, item0_.price as price4_3_, item0_.stock_quantity as stock_qu5_3_, item0_.artist as artist6_3_, item0_.etc as etc7_3_, item0_.author as author8_3_, item0_.isbn as isbn9_3_, item0_.actor as actor10_3_, item0_.director as directo11_3_, item0_.dtype as dtype1_3_ from item item0_

2021-09-03 16:28:36.730  INFO 19308 --- [nio-8080-exec-4] p6spy                                    : #1630654116730 | took 0ms | statement | connection 8| url jdbc:h2:tcp://localhost/~/jpashop

select item0_.item_id as item_id2_3_, item0_.name as name3_3_, item0_.price as price4_3_, item0_.stock_quantity as stock_qu5_3_, item0_.artist as artist6_3_, item0_.etc as etc7_3_, item0_.author as author8_3_, item0_.isbn as isbn9_3_, item0_.actor as actor10_3_, item0_.director as directo11_3_, item0_.dtype as dtype1_3_ from item item0_

select item0_.item_id as item_id2_3_, item0_.name as name3_3_, item0_.price as price4_3_, item0_.stock_quantity as stock_qu5_3_, item0_.artist as artist6_3_, item0_.etc as etc7_3_, item0_.author as author8_3_, item0_.isbn as isbn9_3_, item0_.actor as actor10_3_, item0_.director as directo11_3_, item0_.dtype as dtype1_3_ from item item0_;

2021-09-03 16:28:36.732  INFO 19308 --- [nio-8080-exec-4] p6spy                                    : #1630654116731 | took 0ms | commit | connection 8| url jdbc:h2:tcp://localhost/~/jpashop

;

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

답변 2

·

답변을 작성해보세요.

1

원형 조님의 프로필

원형 조

질문자

2021.09.05

안녕하세요. 말씀해주신대로 하였더니 상품이 잘 저장되었습니다.

추가적으로, 질문사항이 있습니다. 일단 제가 김영한 선생님께서 추천해주신 야생형으로 공부하고 있습니다. 따라서, 아직 트렌잭션에 대해서 잘 모르는 상태입니다. 혹시, 나중에 배우긴 하겠지만 궁금해서 그러는데 선생님께서 정말 간단하게 설명해주실수 있을까요? 

codesweaver님의 프로필

codesweaver

2021.09.06

안녕하세요 원형 조님!

트랜잭션은 간단하게 말하면 '어떤 작업의 단위'를 말합니다. DB에서의 트랜잭션을 예로들어 설명하면,  ATM기기에서 돈을 출금하는 경우를 생각해보겠습니다.

.

클라이언트가 잔고 2만원중 1만원을 찾으려고 합니다. 이때 ATM의 메인컨트롤러는 클라이언트의 잔고에서 1만원 인출이 가능한지 체크하고, 가능하다면 1만원을 잔고에서 마이너스 처리 합니다. 그리고 1만원을 클라이언트에게 지급하도록 개찰구를 컨트롤하는 객체에게 요청합니다. 그러면 개찰구 컨트롤러는 1만원이 현재 ATM 돈통에 잔고로 충분한지 체크하고, 1만원을 센다음 클라이언트에게 지급합니다.

.

만약 이 과정중 단 하나라도 오류가 발생하면 어떻게 될까요? 잔고에서 1만원을 빼고 개찰구 컨트롤러에게 만원을 지급하라고 명령을 내리는것까지는 작동했는데 개찰구 컨트롤러가 먹통이 되어서 멈춰버리면? 클라이언트는 만원을 받지도 못하고 잔고만 사라진 셈입니다. 문제가 심각하죠?

그래서 이러한 문제를 예방하기 위해 위의 모든 작업을 '하나의 단위'로 묶어서 구분짓게 됩니다. 그리고 위의 과정중 하나라도 문제가 생기면 전체 단위의 실패로 처리로 판단하고 원래 상태로 되돌리는 작업을 합니다. (정확히는 '하나의 단위'가 완료되기 전까지 실제로 데이터를 바꾸지 않습니다). 이 단위를 트랜잭션이라고 합니다.

감사합니다.

0

codesweaver님의 프로필

codesweaver

2021.09.03

안녕하세요, 원형 조 님. 공식 서포터즈 codesweaver 입니다.
.
혹시 ItemService 클래스의 saveItem() 메서드 위에 @Transactional 어노테이션이 붙어있는지 확인해주시기 바랍니다. 강의대로 진행하셨다면 ItemService의 위해 @Transactional(readonly=true) 설정이 되어 있으실텐데, 이걸 덮어씌우지 않으면 상품이 저장되지 않을 수 있습니다.

혹시 그래도 해결되지 않으시면 전체 프로젝트 코드를 구글 드라이브에 올려서 공유해주시기 바랍니다.

.
감사합니다.