Posts
Q&A
API ์๋ต ์ํ
๋ง์ฐฌ๊ฐ์ง๋ก ์๋ฌ๊ฐ ๋ฐ์ํด์ catch๊ฐ ํธ์ถ๋๋ ๊ฒฝ์ฐ, ํ๋ฉด ์ชฝ์์ alert์ ๋์ฐ๋ ค๋ฉด ์ด๋ป๊ฒ ํด์ผ ํ๋์?
- Likes
- 1
- Comments
- 2
- Viewcount
- 277
Q&A
Generic ๋ช ์๋ฅผ ํด์ผ ํ๋์? ๋ง์์ผ ํ๋์?
์ฒซ ์ง๋ฌธ์์ ๋๋ค. List๋ผ๋ฉด List์ฐ์๋๊ฒ ๋ง๋๊ฒ๊ฐ์์ ์ง๋ฌธ์์๋ ์ ๊ฐ ์๋ชป ์ ์๋ค์ ใ ใ ์ง๋ฌธ์ ์๋๋ง ์ดํดํ์๋ฉด ๋ ๊ฒ๊ฐ์ต๋๋ค!
- Likes
- 8
- Comments
- 3
- Viewcount
- 646
Q&A
JPA์ Transaction์ ๋ํด์
ํญ์ ๊ฐ์ฌํฉ๋๋ค! ์์ ์ ์ดํด๋์ด์!
- Likes
- 8
- Comments
- 2
- Viewcount
- 939
Q&A
@Transactional ์์์ @Transactional ๋ฉ์๋ ์ฌ์ฉ
๊ฐ์ฌํฉ๋๋ค. ์ ๊ฐ ๊ฐ์ ์๋น์ค ํด๋์ค์์ ํ ์คํธํ์๋ค์.. ํด๊ฒฐ๋์ต๋๋ค! ๊ทธ๋ผ ๊ฐ์ ์๋น์ค ํด๋์ค์์๋ ๋์ผํ EntityManager๋ฅผ ์ฌ์ฉํ๊ธฐ ๋๋ฌธ์ REQUIRES_NEW๋ก ์ค์ ํด๋ ๋์ผํ ์์์ฑ ์ปจํ ์คํธ๋ฅผ ์์ฑํ๋๊ฑด๊ฐ์?? REQUIRES_NEW๋ก ์ค์ ํ๋ฉด ๋ถ๋ชจ ํธ๋์ญ์ ์ด ์๋๋ผ๋ ์๋ก์ด ํธ๋์ญ์ ์ ์์ฑํ๋ค๊ณ ํ๊ธฐ์.. ์๋ก ๋ค๋ฅธ ์์์ฑ ์ปจํ ์คํธ๋ฅผ ์ฌ์ฉํ ๊ฒ ๊ฐ์๋๋ฐ ๊ฒฐ๊ณผ๋ ์๋๋ค์.. public class TransactionService { private final EntityManager em; @Transactional public void outerTransaction(){ innerTransaction(); System.out.println("Outer : "+ em.getDelegate()); System.out.println("Outer : "+ em.find(Member.class", 1L); } @Transactional(propagation = Propagation.REQUIRES_NEW) public void innerTransaction(){ System.out.println("Inner : " + em.getDelegate()); System.out.println("Inner : "+ em.find(Member.class", 1L); } } ์ฃผ๋ง์ธ๋ฐ๋ ๋ต๋ณํด์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค..!
- Likes
- 3
- Comments
- 6
- Viewcount
- 2K
Q&A
@Transactional ์์์ @Transactional ๋ฉ์๋ ์ฌ์ฉ
๋ฐฉ๋ฒ์ ์๋ ค์ฃผ์ ์ ๋ ๊ฐ์ฌํฉ๋๋ค ใ ใ ... ์ง์ง ์ฐธ ์ค์น๋์ด์ธ์.. 1๋ฒ 2๋ฒ ๋ชจ๋ ํ ์คํธํด๋ดค๊ณ , propagation์ REQUIRES_NEW๋ก ํด๋ ๊ฒฐ๊ณผ๋ ๋๊ฐ๋ค์..! ์์์ฑ ์ปจํ ์คํธ๋ฅผ ๊ณต์ ํ๋๊ตฐ์. ์ ๊ฐ ์๋ชป ํ ์คํธํ๊ฑด ์๋๊ฒ ์ฃ ? ใ ใ ๊ฐ์ฌํฉ๋๋ค!
- Likes
- 3
- Comments
- 6
- Viewcount
- 2K
Q&A
@Transactional ์์์ @Transactional ๋ฉ์๋ ์ฌ์ฉ
Propagaion์ด REQUIRED์ธ ๊ฒฝ์ฐ์ REQUIRES_NEW์ธ ๊ฒฝ์ฐ๊ฐ ๋ค๋ฅด๊ฒ ๋์ํ์ง ์์๊น ์๊ฐ์ ๋๋๋ฐ.. ์ง์๋ง ๋ ๋ฟ ์ ๋ณด๋ฅผ ๋ชป์ฐพ๊ฒ ์ต๋๋ค..! ๋์์ฃผ์ธ์!
- Likes
- 3
- Comments
- 6
- Viewcount
- 2K




