Announcement Announcement Module
Collapse
No announcement yet.
SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunna ble.run(SimpleAsyncTaskExecutor.jav Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunna ble.run(SimpleAsyncTaskExecutor.jav

    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:batch="http://www.springframework.org/schema/batch"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns="http://www.springframework.org/schema/p"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schem...-beans-2.5.xsd
    http://www.springframework.org/schema/batch
    http://www.springframework.org/schem...-batch-2.0.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schem...ng-aop-2.5.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">

    <bean id="jobExplorer"
    class="org.springframework.batch.core.explore.supp ort.JobExplorerFactoryBean"
    p:dataSource-ref="dataSource" />

    <bean id="jobLauncher" class="org.springframework.batch.core.launch.suppo rt.SimpleJobLauncher">
    <property name="jobRepository" ref="jobRepository" />
    <property name="taskExecutor" ref="taskExecutor" />
    </bean>

    <bean id="taskExecutor" class="org.springframework.core.task.SimpleAsyncTa skExecutor" >
    <property name="concurrencyLimit" value="4"/>
    </bean>
    <bean id="jobRepository" class="org.springframework.batch.core.repository.s upport.MapJobRepositoryFactoryBean">
    <property name="transactionManager" ref="transactionManager"/>
    </bean>
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSou rceTransactionManager">
    <property name="dataSource" ref="dataSource"/>
    </bean>
    <bean id="partitioner" class="org.springframework.batch.core.partition.su pport.SimplePartitioner"/>

    <batch:job id="dcjob" restartable="true">
    <batch:split id="dcsplit" task-executor="taskExecutor">
    <batch:flow>
    <batch:step id="step_44">
    <batch:tasklet ref="task_44" allow-start-if-complete="true" transaction-manager="transactionManager" />
    </batch:step>
    </batch:flow>
    <batch:flow>
    <batch:step id="step_46">
    <batch:tasklet ref="task_46" allow-start-if-complete="true" transaction-manager="transactionManager" />
    </batch:step>
    </batch:flow>
    </batch:split>
    </batch:job>

    <bean id="storedProcedureTasklet" class="com.sample.springbatch.dc.automation.Stored ProcedureTasklet" >
    <property name="dataSource" ref="dataSource"/>
    </bean>

    <bean id="task_44" parent="storedProcedureTasklet">
    <property name="storedProcedureName" value="SP44"/>
    </bean>

    <bean id="task_46" parent="storedProcedureTasklet">
    <property name="storedProcedureName" value="SP46"/>
    </bean>

    <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
    ......
    <property name="initialSize" value="8"/>
    </bean>

    I don't want to use Spring Batch Framework tables hence I used MapJobRepositoryFactoryBean.
    I'm getting below error.Please suggest to
    1. Fix error
    2. Also ,please let me know where the throttle-limit can be defined for above configuration without using chunk's..?

    16:37:14,609 ERROR SimpleAsyncTaskExecutor-1 AbstractJob:274 - Encountered fatal error executing job
    org.springframework.batch.core.JobExecutionExcepti on: Flow execution ended unexpectedly
    at org.springframework.batch.core.job.flow.FlowJob.do Execute(FlowJob.java:110)
    at org.springframework.batch.core.job.AbstractJob.exe cute(AbstractJob.java:250)
    at org.springframework.batch.core.launch.support.Simp leJobLauncher$1.run(SimpleJobLauncher.java:110)
    at org.springframework.core.task.SimpleAsyncTaskExecu tor$ConcurrencyThrottlingRunnable.run(SimpleAsyncT askExecutor.java:192)
    at java.lang.Thread.run(Thread.java:736)
    Caused by: org.springframework.batch.core.job.flow.FlowExecut ionException: Ended flow=dcjob at state=dcsplit with exception
    at org.springframework.batch.core.job.flow.support.Si mpleFlow.resume(SimpleFlow.java:148)
    at org.springframework.batch.core.job.flow.support.Si mpleFlow.start(SimpleFlow.java:124)
    at org.springframework.batch.core.job.flow.FlowJob.do Execute(FlowJob.java:105)
    ... 4 more


    Sometimes with no change in code and configration.
    I'm getting :-
    16:59:32,312 ERROR SimpleAsyncTaskExecutor-3 TaskletStep:314 - Rollback caused by fatal failure failed
    org.springframework.transaction.IllegalTransaction StateException: Transaction is already completed - do not call commit or rollback more than once per transaction
    at org.springframework.transaction.support.AbstractPl atformTransactionManager.rollback(AbstractPlatform TransactionManager.java:795)
    at org.springframework.batch.core.step.tasklet.Taskle tStep.rollback(TaskletStep.java:368)
    at org.springframework.batch.core.step.tasklet.Taskle tStep.access$1000(TaskletStep.java:68)
    at org.springframework.batch.core.step.tasklet.Taskle tStep$2.doInChunkContext(TaskletStep.java:309)
    at org.springframework.batch.core.scope.context.StepC ontextRepeatCallback.doInIteration(StepContextRepe atCallback.java:67)
    at org.springframework.batch.repeat.support.RepeatTem plate.getNextResult(RepeatTemplate.java:352)
    at org.springframework.batch.repeat.support.RepeatTem plate.executeInternal(RepeatTemplate.java:212)
    at org.springframework.batch.repeat.support.RepeatTem plate.iterate(RepeatTemplate.java:143)
    at org.springframework.batch.core.step.tasklet.Taskle tStep.doExecute(TaskletStep.java:239)
    at org.springframework.batch.core.step.AbstractStep.e xecute(AbstractStep.java:197)
    at org.springframework.batch.core.job.AbstractJob.han dleStep(AbstractJob.java:348)
    at org.springframework.batch.core.job.flow.FlowJob.ac cess$100(FlowJob.java:43)
    at org.springframework.batch.core.job.flow.FlowJob$Jo bFlowExecutor.executeStep(FlowJob.java:137)
    at org.springframework.batch.core.job.flow.support.st ate.StepState.handle(StepState.java:60)
    at org.springframework.batch.core.job.flow.support.Si mpleFlow.resume(SimpleFlow.java:144)
    at org.springframework.batch.core.job.flow.support.Si mpleFlow.start(SimpleFlow.java:124)
    at org.springframework.batch.core.job.flow.support.st ate.SplitState$1.call(SplitState.java:82)
    at org.springframework.batch.core.job.flow.support.st ate.SplitState$1.call(SplitState.java:80)
    at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:314)
    at java.util.concurrent.FutureTask.run(FutureTask.jav a:149)
    at org.springframework.core.task.SimpleAsyncTaskExecu tor$ConcurrencyThrottlingRunnable.run(SimpleAsyncT askExecutor.java:192)
    at java.lang.Thread.run(Thread.java:736)
    Last edited by bhushan; Oct 8th, 2012, 05:16 PM.
Working...
X