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

时间:2015-08-20 15:19:10

标签: spring-batch

我在昨晚6点左右开始了我的春季批量工作(有16个步骤)。由于这是第一次运行,我预计它需要几个小时,并在今天早上完成。但是,在第一步读取和写入大约100万条记录后,工作就停止了。我已经提出了一种机制来重新启动作业,以防作业根据作业状态失败。 但是,

  • BATCH_JOB_EXECUTION表中的作业状态显示status =" STARTED"退出代码=" UNKNOWN"
  • BATCH_STEP_EXECUTION中的步骤状态显示status =" STARTED"和退出代码=" 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>

0 个答案:

没有答案