From c1df7ca791c352623a00bc5ebc7c3f8c6ccf0f94 Mon Sep 17 00:00:00 2001 From: gitjiho Date: Sat, 26 Oct 2024 12:55:58 +0900 Subject: [PATCH] =?UTF-8?q?deploy:=20=EB=8D=94=EB=AF=B8=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EC=8B=A4=ED=96=89=20=EB=B3=84=EB=8F=84=EC=9D=98=20?= =?UTF-8?q?=ED=8A=B8=EB=9E=9C=EC=9E=AD=EC=85=98=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=88=98=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/sinitto/common/dummy/InitialData.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/example/sinitto/common/dummy/InitialData.java b/src/main/java/com/example/sinitto/common/dummy/InitialData.java index 4f828723..98e8ccdf 100644 --- a/src/main/java/com/example/sinitto/common/dummy/InitialData.java +++ b/src/main/java/com/example/sinitto/common/dummy/InitialData.java @@ -26,6 +26,7 @@ import com.example.sinitto.sinitto.repository.SinittoBankInfoRepository; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDate; @@ -72,13 +73,13 @@ public InitialData(MemberRepository memberRepository, SeniorRepository seniorRep } @Override - @Transactional public void run(String... args) { initial(); saveRefreshTokenToRedis(); } - private void saveRefreshTokenToRedis() { + @Transactional(propagation = Propagation.REQUIRES_NEW) + protected void saveRefreshTokenToRedis() { System.out.println("---------------[더미데이터] 멤버별 RefreshToken---------------"); System.out.printf("시니또1 김철수(MemberId : 1)의 refreshToken : %s%n", tokenService.generateRefreshToken("1chulsoo@example.com")); System.out.printf("시니또2 김유진(MemberId : 2)의 refreshToken : %s%n", tokenService.generateRefreshToken("2kim@example.com")); @@ -93,7 +94,8 @@ private void saveRefreshTokenToRedis() { System.out.println("----------------------------------------------------------"); } - private void initial() { + @Transactional + protected void initial() { //시니또 Member memberSinitto1 = memberRepository.save(new Member("김철수", "01012345678", "1chulsoo@example.com", true)); sinittoBankInfoRepository.save(new SinittoBankInfo("신한은행", "123-23-444-422", memberSinitto1));