Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/371.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Spring批处理数据库插入问题_Java_Database_Spring Batch - Fatal编程技术网

Java Spring批处理数据库插入问题

Java Spring批处理数据库插入问题,java,database,spring-batch,Java,Database,Spring Batch,我使用SpringBatch将100000多条记录从csv插入DB <bean id="transactionManager" class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" /> <bean id="asyncTaskExecutor" class="org.springframework.core.task.SimpleAsyncTask

我使用SpringBatch将100000多条记录从csv插入DB

<bean id="transactionManager"
        class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" />
<bean id="asyncTaskExecutor" class="org.springframework.core.task.SimpleAsyncTaskExecutor" />   
<batch:job id="loadDirect2ResponseToDB">
        <batch:step id="step1">
            <batch:tasklet>
                <batch:chunk reader="direct2CsvFileItemReader"
                    processor="direct2DBDataProcessor" writer="direct2DBItemWriter"
                    commit-interval="100" skip-limit="100">

                    <batch:skippable-exception-classes>
                        <batch:include class="java.lang.Exception" />
                    </batch:skippable-exception-classes>

                </batch:chunk>
        </batch:tasklet>
        </batch:step>

    </batch:job>

在插入某些记录时,它是100乘100插入的。有时,对于块,它会一个接一个地插入

有人能帮忙吗?为什么要一个接一个地插入

我瞥了一眼,以便更好地了解可能发生的情况,但有几个问题没有回答:首先,为什么你跳过任何例外?第二,您是否记录了这些异常,以便确定批处理可能失败的原因?您是否已经阅读并记录了这些异常?