Spring batch Spring批处理挂起,没有状态更新

Spring batch Spring批处理挂起,没有状态更新,spring-batch,Spring Batch,昨晚6:00左右,我开始了我的春季批量作业(共16个步骤)。由于这是第一次运行,我预计需要几个小时,并在今天上午完成。然而,在第一步读写了大约100万条记录之后,这项工作就暂停了。我已经根据作业状态设置了一种机制,以便在作业失败时重新启动作业。 但是, 批处理作业执行表中的作业状态显示status=“STARTED”,退出代码为=“UNKNOWN” 批处理步骤执行中的步骤状态显示status=“STARTED”和exit code=“EXECUTING” 在这种情况下,如何优雅地终止作业,以

昨晚6:00左右,我开始了我的春季批量作业(共16个步骤)。由于这是第一次运行,我预计需要几个小时,并在今天上午完成。然而,在第一步读写了大约100万条记录之后,这项工作就暂停了。我已经根据作业状态设置了一种机制,以便在作业失败时重新启动作业。 但是,

  • 批处理作业执行表中的作业状态显示status=“STARTED”,退出代码为=“UNKNOWN”
  • 批处理步骤执行中的步骤状态显示status=“STARTED”和exit code=“EXECUTING”
在这种情况下,如何优雅地终止作业,以便重新启动作业?这是处理这种情况的最佳方式吗

我是否缺少任何配置属性?我应该设置任何附加属性吗? 我的数据源配置如下:

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
            <property name="driverClassName" value="com.informix.jdbc.IfxDriver"/>
            <property name="url" value="<DBURL>" />
            <property name="username" value="<USERID>"  />
            <property name="password" value="<PASSWORD>" />
            <property name="initialSize" value="25" />
            <property name="maxIdle" value="15" /> <!-- maxIdle..The maximum number of connections that should be kept in the pool at all times. Idle connections are checked periodically (if enabled) and connections that have been idle for longer than minEvictableIdleTimeMillis are released. See also testWhileIdle. -->
            <property name="minIdle" value="5" /><!-- minIdle...The minimum number of established connections that should be kept in the pool at all times. The connection pool can shrink below this number if validation queries fail. The default value is derived from initialSize. -->
            <property name="maxActive" value="20" /> <!-- maxActive..The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit. -->
            <property name="maxWait" value="3000" /> <!-- maxWait..The maximum milliseconds a pool with no available connections will wait for a connection to be returned before throwing an exception, or -1 to wait indefinitely. -->
            <property name="removeAbandonedTimeout" value="2700" /> <!--removeAbandonedTimeout..Setting 15 minuts. Timeout in seconds before an abandoned connection can be removed. The value should be set to the longest running query your applications might have. -->
            <property name="logAbandoned" value="true" /> <!--logAbandoned.. Set to true to log stack traces for application code that abandons a Connection. Logging an abandoned Connection adds overhead for every Connection open because a stack trace has to be generated. -->
            <property name="idleConnectionTestPeriod" value="300" />    Test all connections in the pool every 5 minutes using the preferredTestQuery above -->
    </bean>

    <bean id="readerdataSource" class="org.apache.commons.dbcp.BasicDataSource">
            <property name="driverClassName" value="com.informix.jdbc.IfxDriver"/>
            <property name="url" value="<DBURL>" />
            <property name="username" value="<USERID>"  />
            <property name="password" value="<PASSWORD>" />
            <property name="defaultReadOnly" value="true" />
            <property name="initialSize" value="25" />
            <property name="maxIdle" value="15" /> <!-- maxIdle..The maximum number of connections that should be kept in the pool at all times. Idle connections are checked periodically (if enabled) and connections that have been idle for longer than minEvictableIdleTimeMillis are released. See also testWhileIdle. -->
            <property name="minIdle" value="5" /><!-- minIdle...The minimum number of established connections that should be kept in the pool at all times. The connection pool can shrink below this number if validation queries fail. The default value is derived from initialSize. -->
            <property name="maxActive" value="20" /> <!-- maxActive..The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit. -->
            <property name="maxWait" value="3000" /> <!-- maxWait..The maximum milliseconds a pool with no available connections will wait for a connection to be returned before throwing an exception, or -1 to wait indefinitely. -->
            <property name="removeAbandonedTimeout" value="2700" /> <!--removeAbandonedTimeout..Setting 15 minuts. Timeout in seconds before an abandoned connection can be removed. The value should be set to the longest running query your applications might have. -->
            <property name="logAbandoned" value="true" /> <!--logAbandoned.. Set to true to log stack traces for application code that abandons a Connection. Logging an abandoned Connection adds overhead for every Connection open because a stack trace has to be generated. -->
            <property name="defaultTransactionIsolation" value="1"/>
    </bean>

使用上面的preferredTestQuery-->

这可能很晚了,但一个解决方案是确保步骤的线程数与数据源的“maxActive”参数一致。因此,在多线程步骤中,throttleLimit=maxActive,在分区步骤中,分区数=maxActive。