Merge pull request '배치 2007 설정 수정' (#91) from feature/cha into dev

Reviewed-on: #91
This commit is contained in:
ysCha 2025-06-17 14:26:41 +09:00
commit 0c9018e9b0

View File

@ -5,6 +5,7 @@ import javax.sql.DataSource;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean;
import org.springframework.batch.item.database.support.DefaultDataFieldMaxValueIncrementerFactory;
import org.springframework.batch.support.DatabaseType;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -34,12 +35,13 @@ public class BatchConfiguration {
factory.setTablePrefix("BATCH_");
// 격리 레벨 설정
factory.setIsolationLevelForCreate("ISOLATION_SERIALIZABLE");
factory.setIsolationLevelForCreate("ISOLATION_READ_COMMITTED");
factory.setIncrementerFactory(new DefaultDataFieldMaxValueIncrementerFactory(dataSource));
// SQL Server 데이터베이스 타입 설정
//factory.setDatabaseType(DatabaseType.SQLSERVER.getProductName());
factory.setDatabaseType("sqlserver");
factory.afterPropertiesSet();
return factory.getObject();
}