|
|
@@ -2,9 +2,13 @@ package com.style24.admin.biz.service;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Isolation;
|
|
|
+import org.springframework.transaction.annotation.Propagation;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import com.style24.admin.biz.dao.TsaCommonDao;
|
|
|
import com.style24.persistence.domain.SearchData;
|
|
|
+import com.style24.persistence.domain.Sequence;
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
@@ -21,6 +25,25 @@ public class TsaCommonService {
|
|
|
@Autowired
|
|
|
private TsaCommonDao commonDao;
|
|
|
|
|
|
+ /**
|
|
|
+ * 시퀀스 조회(중첩트랜잭션으로 처리. 부모 트랜잭션의 커밋과 롤백에는 영향을 받지만 자신의 커밋과 롤백은 부모 트랜잭션에게 영향을 주지 않는다.)
|
|
|
+ * @param sequenceNm - 시퀀스명
|
|
|
+ * @return
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 1. 4
|
|
|
+ */
|
|
|
+ @Transactional(value = "shopTxnManager", isolation = Isolation.SERIALIZABLE, propagation = Propagation.NESTED)
|
|
|
+ public Integer getNextSequence(String sequenceNm) {
|
|
|
+ Integer nextVal = commonDao.getNextSequence(sequenceNm);
|
|
|
+
|
|
|
+ Sequence sequence = new Sequence();
|
|
|
+ sequence.setSequenceNm(sequenceNm);
|
|
|
+ sequence.setNextVal(nextVal);
|
|
|
+ commonDao.createNextSequence(sequence);
|
|
|
+
|
|
|
+ return sequence.getNextVal();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 엑셀조회를 위한 SEARCH 테이블 삭제
|
|
|
*
|
|
|
@@ -80,5 +103,4 @@ public class TsaCommonService {
|
|
|
return commonDao.getErpSyncYn();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|