spring batch ํธ๋์ญ์
์ง๋ฌธ์
๋๋ค.
์๋
ํ์ธ์~ ์์ ๋งํฌ ๊ฑธ์ด์ฃผ์ ๊ธ ์ ์์
๋๋ค.spring-batch์์ ํธ๋์ญ์
์ด ๋ฌธ์ ๊ฐ ๋๋ ๋ถ๋ถ์ Job ์คํ ๋น์์ Job์ ๊ฐ์ธํ๊ณ ์๋ ํธ๋์ญ์
์
๋๋ค.์์ ์ฒจ๋ถํ์ ์ฝ๋๋ Job์ ์คํํ๋ ์ฝ๋๊ฐ ์๋๋๋ค. Job๊ณผ Step์ ๋น๋ํ๋ ์ฝ๋์ ํธ๋์ญ์
์ ๋ถ์ฌ์ฃผ์ ๊ฑฐ๋ผ์ ์ผ์ด์ค๊ฐ ๋ค๋ฆ
๋๋ค.```DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor(new MethodInterceptor() { @Override public Object invoke(MethodInvocation invocation) throws Throwable { if (TransactionSynchronizationManager.isActualTransactionActive()) { throw new IllegalStateException( "Existing transaction detected in JobRepository. " + "Please fix this and try again (e.g. remove @Transactional annotations from client).");```spring-batch ์ฝ๋๋ฅผ ๋ณด์๋ฉด MethodInterceptor์์ ํ์ฑ ํธ๋์ญ์
์ฌ๋ถ๋ฅผ ์ฒดํฌํ๋ ๋ก์ง์ ๊ตฌํํด Batch Job์คํ ์์ ์ ๊ธฐ์กด์ ํ์ฑํ๋ ํธ๋์ญ์
์ด ์๋์ง ์ฒดํฌํ๋๋ก ์ฝ๋๊ฐ ์์ฑ๋ผ์๋๊ฑธ ํ์ธํ์ค ์ ์์ต๋๋ค.