Spring MDC๋ฅผ ์‚ฌ์šฉํ•ด ์‹๋ณ„๊ฐ€๋Šฅํ•œ ๋กœ๊ทธ ๋‚จ๊ธฐ๊ธฐ

โœ… Spring MDC๋ฅผ ์‚ฌ์šฉํ•ด ์‹๋ณ„๊ฐ€๋Šฅํ•œ ๋กœ๊ทธ ๋‚จ๊ธฐ๊ธฐ์šด์˜์„ ํ•˜๋‹ค ๋ณด๋ฉด ๋กœ๊ทธ๋ฅผ ์ถ”์ ํ•ด์„œ ํ™•์ธํ•ด์•ผ ํ• ๋•Œ๊ฐ€ ์ƒ๊ธฐ๋Š”๋ฐ ์—ฌ๋Ÿฌ ์š”์ฒญ์ด ํ•œ๊บผ๋ฒˆ์— ๋“ค์–ด์˜ค๋ฉด ๋กœ๊ทธ๊ฐ€ ์ˆœ์„œ ์—†์ด ์Œ“์—ฌ ํ™•์ธํ•˜๊ธฐ ์–ด๋ ค์šธ๋•Œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Ÿด๋•Œ ์š”์ฒญ๋‹น ์œ ๋‹ˆํฌํ•œ ๊ฐ’์„ ์ฃผ์–ด ๋กœ๊ทธ์— ํ•จ๊ป˜ ์ถœ๋ ฅํ•จ์œผ๋กœ์จ ์ถ”์ ํ• ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.MDC (Mapped Diagnostic Context)- ๋ฉ€ํ‹ฐ ์“ฐ๋ ˆ๋“œํ™˜๊ฒฝ์—์„œ ํ˜„์žฌ ์‹คํ–‰์ค‘์ธ ์“ฐ๋ ˆ๋“œ์— ๋ฉ”ํƒ€ ์ •๋ณด๋ฅผ ๋„ฃ๊ณ  ๊ด€๋ฆฌํ•˜๋Š” ๊ณต๊ฐ„์ž…๋‹ˆ๋‹ค. ๋‚ด๋ถ€์ ์œผ๋กœ Map์œผ๋กœ ๊ด€๋ฆฌํ•˜๊ณ  ์žˆ๊ณ  ThreadLocal์— ํ‚ค ๊ฐ’์„ ์ €์žฅํ•˜์—ฌ Thread๊ฐ€ ์กด์žฌํ•˜๋Š” ๋™์•ˆ ๊ณ„์† ์‚ฌ์šฉํ• ์ˆ˜ ์žˆ๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค. โœ… MDC ํ•„ํ„ฐ์— ๊ตฌํ˜„ํ•˜๊ธฐ@Component@Order(Ordered.HIGHEST_PRECEDENCE)public class MDCLoggingFilter imp..

MyBatis์˜ ResultHandler๋ฅผ ํ†ตํ•ด POI SXSSF๋กœ ๋Œ€์šฉ๋Ÿ‰ ์—‘์…€ํŒŒ์ผ ๋งŒ๋“ค๊ธฐ

โœ… MyBatis์˜ ResultHandler๋ฅผ ํ†ตํ•ด POI SXSSF๋กœ ๋Œ€์šฉ๋Ÿ‰ ์—‘์…€ํŒŒ์ผ ๋งŒ๋“ค๊ธฐ๊ฐœ๋ฐœํ™˜๊ฒฝSpringBoot 2.6.2JAVA 1.8Gradle 7.3.2IntelliJ์ •์‚ฐ ๋ฐ์ดํ„ฐ๋ฅผ ์—‘์…€ํŒŒ์ผ๋กœ ๋งŒ๋“œ๋Š” ๊ณผ์ •์—์„œ ์ ์€ ๊ฑด์ˆ˜๋ฅผ ๋งŒ๋“ค๋•Œ๋Š” ์ด์Šˆ๊ฐ€ ์—†์—ˆ์ง€๋งŒ ๋ช‡์‹ญ๋งŒ ๊ฑด ๋˜๋Š” ๋ช‡๋ฐฑ๋งŒ๊ฑด์˜ ๋ฐ์ดํ„ฐ๋ฅผ ํ•œ๋ฒˆ์— ํ˜ธ์ถœํ•˜๊ฒŒ ๋˜๋ฉด์„œ OOM์„ ๋งŒ๋‚˜๊ฒŒ ๋˜์–ด ์—‘์…€ํŒŒ์ผ๋กœ ์ €์žฅ์„ ํ•  ์ˆ˜๊ฐ€ ์—†์—ˆ์Šต๋‹ˆ๋‹ค. MyBatis๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋‹ค๋ฉด MyBatis์—์„œ ์ œ๊ณตํ•˜๋Š” ResultHandler๋ฅผ ์ด์šฉํ•˜๋ฉด ๋ช‡๋ฐฑ๋งŒ๊ฑด์˜ ๋ฐ์ดํ„ฐ๋ฅผ ํ•œ๋ฒˆ์— ํ˜ธ์ถœํ•˜์ง€ ์•Š๊ณ  ๋ ˆ์ฝ”๋“œ๋ณ„๋กœ ๋‹ค๋ฃฐ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.https://mybatis.org/mybatis-3/ko/java-api.html#SqlSession (์•„๋ž˜ ResultHandler ์ฐธ๊ณ )๋‹ค์Œ์€ ๊ฐ€์ง€๊ณ  ์˜จ ๋ฐ์ดํ„ฐ์˜ ์ €์žฅ..

๊ณต์ง€์‚ฌํ•ญ
์ตœ๊ทผ์— ์˜ฌ๋ผ์˜จ ๊ธ€
์ตœ๊ทผ์— ๋‹ฌ๋ฆฐ ๋Œ“๊ธ€
Total
Today
Yesterday
๋งํฌ
ยซ   2024/12   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
๊ธ€ ๋ณด๊ด€ํ•จ
๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ (80)
๐Ÿ“บ Develop (0)
โš™๏ธ Architecture (1)
๐ŸŽจ Design Pattern (2)
๐ŸŒด Spring (8)
โœ๏ธ JAVA (2)
๐ŸŽฏ Python (6)
๐Ÿ•‹ Server (20)
๐Ÿ›ณ Build (2)
๐Ÿ—‚๏ธ Etc (13)
๐ŸŒ‹ Error Fixed (5)
๐Ÿ— Tool (5)
๐Ÿ’ป MacBook M1 (15)
๐Ÿ“ฆ ETC (1)

์ด ํฌ์ŠคํŒ…์€ ์ฟ ํŒก ํŒŒํŠธ๋„ˆ์Šค ํ™œ๋™์˜ ์ผํ™˜์œผ๋กœ, ์ด์— ๋”ฐ๋ฅธ ์ผ์ •์•ก์˜ ์ˆ˜์ˆ˜๋ฃŒ๋ฅผ ์ œ๊ณต๋ฐ›์Šต๋‹ˆ๋‹ค.