diff --git a/src/main/java/com/interplug/qcast/config/batch/BatchConfiguration.java b/src/main/java/com/interplug/qcast/config/batch/BatchConfiguration.java
index ac743c0e..0f1f7baf 100644
--- a/src/main/java/com/interplug/qcast/config/batch/BatchConfiguration.java
+++ b/src/main/java/com/interplug/qcast/config/batch/BatchConfiguration.java
@@ -1,12 +1,11 @@
package com.interplug.qcast.config.batch;
+
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;
import org.springframework.context.annotation.Primary;
@@ -15,35 +14,39 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.transaction.PlatformTransactionManager;
/**
- * Spring Batch Configuration for SQL Server without sequence support
+ * Spring Batch configuration for SQL Server 2008 without sequence support.
*/
@Configuration
-@EnableBatchProcessing(modular = false)
+@EnableBatchProcessing
public class BatchConfiguration {
/**
- * Custom JobRepository that uses table-based ID generation instead of sequences
+ * Configuring JobRepository for SQL Server 2008.
+ * Uses table-based ID generation instead of sequences.
*/
@Bean
@Primary
- public JobRepository jobRepository(DataSource dataSource,
- PlatformTransactionManager transactionManager) throws Exception {
+ public JobRepository jobRepository(DataSource dataSource, PlatformTransactionManager transactionManager) throws Exception {
JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
factory.setDataSource(dataSource);
factory.setTransactionManager(transactionManager);
- factory.setDatabaseType("sqlserver");
- factory.setIsolationLevelForCreate("ISOLATION_READ_COMMITTED");
- // 시퀀스 없이 max(id)+1 방식으로 증가
- factory.setIncrementerFactory(new DefaultDataFieldMaxValueIncrementerFactory(dataSource));
+ // Use TABLE_PREFIX to map to Spring Batch tables
+ factory.setTablePrefix("BATCH_");
+ // Isolation level setting for SQL Server
+ factory.setIsolationLevelForCreate("ISOLATION_SERIALIZABLE");
+
+ // Set to "SQLSERVER" for Spring Batch compatibility
+ factory.setDatabaseType("SQLSERVER");
+
+ // Finalize factory setup
factory.afterPropertiesSet();
return factory.getObject();
-
}
/**
- * TaskExecutor for async batch processing
+ * TaskExecutor for batch processing (multithreading support).
*/
@Bean
public TaskExecutor batchTaskExecutor() {
@@ -51,7 +54,7 @@ public class BatchConfiguration {
executor.setCorePoolSize(5);
executor.setMaxPoolSize(10);
executor.setQueueCapacity(25);
- executor.setThreadNamePrefix("batch-");
+ executor.setThreadNamePrefix("batch-thread-");
executor.initialize();
return executor;
}
diff --git a/src/main/resources/config/application-dev.yml b/src/main/resources/config/application-dev.yml
index b655727c..55e9d1c2 100644
--- a/src/main/resources/config/application-dev.yml
+++ b/src/main/resources/config/application-dev.yml
@@ -24,7 +24,7 @@ spring:
schema:
job:
names: ${job.name:NONE}
- enabled: true
+ enabled: false
profiles:
scheduler: Y
batch:
diff --git a/src/main/resources/logback/logback-dev.xml b/src/main/resources/logback/logback-dev.xml
index 0356cb1d..d13a536a 100644
--- a/src/main/resources/logback/logback-dev.xml
+++ b/src/main/resources/logback/logback-dev.xml
@@ -36,4 +36,14 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file