From bb8db75b6a88d5d4b9db3528f53a1f7307f3ef84 Mon Sep 17 00:00:00 2001 From: SeoJin Kim Date: Mon, 14 Jun 2021 17:06:11 +0900 Subject: [PATCH] =?UTF-8?q?[Spring][=EC=87=BC=ED=95=91=EB=AA=B0=20?= =?UTF-8?q?=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8][27]=20=EC=97=85=EB=A1=9C?= =?UTF-8?q?=EB=93=9C=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D=20-=205=20(=ED=8A=B8=EB=9E=9C=EC=9E=AD?= =?UTF-8?q?=EC=85=98=20=EC=A0=81=EC=9A=A9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://kimvampa.tistory.com/231 --- .../main/java/com/vam/service/AdminServiceImpl.java | 2 ++ VamPa/src/main/webapp/WEB-INF/spring/root-context.xml | 10 +++++++++- .../test/java/com/vam/service/AdminServiceTests.java | 4 ++-- .../main/java/com/vam/service/AdminServiceImpl.java | 2 ++ .../src/main/webapp/WEB-INF/spring/root-context.xml | 10 +++++++++- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/VamPa/src/main/java/com/vam/service/AdminServiceImpl.java b/VamPa/src/main/java/com/vam/service/AdminServiceImpl.java index e8813e5..863fb6c 100644 --- a/VamPa/src/main/java/com/vam/service/AdminServiceImpl.java +++ b/VamPa/src/main/java/com/vam/service/AdminServiceImpl.java @@ -4,6 +4,7 @@ import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import com.vam.mapper.AdminMapper; import com.vam.model.AttachImageVO; @@ -21,6 +22,7 @@ public class AdminServiceImpl implements AdminService { private AdminMapper adminMapper; /* 상품 등록 */ + @Transactional @Override public void bookEnroll(BookVO book) { diff --git a/VamPa/src/main/webapp/WEB-INF/spring/root-context.xml b/VamPa/src/main/webapp/WEB-INF/spring/root-context.xml index 912de94..6c8fb70 100644 --- a/VamPa/src/main/webapp/WEB-INF/spring/root-context.xml +++ b/VamPa/src/main/webapp/WEB-INF/spring/root-context.xml @@ -3,9 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mybatis-spring="http://mybatis.org/schema/mybatis-spring" + xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://mybatis.org/schema/mybatis-spring http://mybatis.org/schema/mybatis-spring-1.2.xsd http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd"> + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">