Announcement Announcement Module
No announcement yet.
Concurrent Processing Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Concurrent Processing


    How to do parallel processing for the following job?
    please let me know how to change the configuration

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns=""

    <description>Example for Hibernate integration.</description>

    <bean id="hibernateJob" parent="simpleJob">
    <!-- set restartable=false so that this job can be used by more than one test -->
    <property name="restartable" value="true" />
    <property name="steps">
    <bean id="step1" parent="simpleStep">
    <!--<property name="skipLimit" value="0" />-->
    <property name="itemReader" ref="hibernateItemReader" />
    <property name="itemWriter" ref="hibernateItemWriter" />
    <property name="commitInterval" value="1" />
    <!--<property name="skippableExceptionClasses" value="java.lang.Exception"/>-->
    <property name="listeners" ref="stepListener" />
    <property name="exceptionHandler" ref="stepListener" />

    <!-- This is a framework class that needs a delegate and also needs to be registered as a RepeatInterceptor in the chunk -->
    <bean id="hibernateItemWriter"
    class="org.springframework.batch.item.database.Hib ernateAwareItemWriter">
    <property name="sessionFactory" ref="sessionFactory" />
    <property name="delegate" ref="hibernateCreditWriter" />

    <bean id="hibernateCreditWriter"
    class="com.met.ib.upi.batch.item.processor.Custome rCreditProcessor">
    <property name="customerCreditDao" ref="customerCreditDao" />
    <property name="hibernateBO" ref="hibernateBO"/>
    <bean id="hibernateBO"
    <bean id="customerCreditDao"
    class="com.met.ib.upi.batch.dao.HibernateCreditWri ter">
    <property name="sessionFactory" ref="sessionFactory" />

    <bean id="hibernateItemReader"
    class="org.springframework.batch.item.database.Hib ernateCursorItemReader">
    <property name="queryString" value="from TempTable" />
    <property name="sessionFactory" ref="sessionFactory" />
    <bean id="stepListener"
    class="com.met.ib.upi.batch.exceptionHandler.StepE xceptionHandler">

  • #2
    The HibernateCursorItemReader is not thread safe, so you can't run in multiple threads by just a change to the configuration. You need to implement the item reader in a thread safe way (look at StagingItemReader for an example of how to do that). It isn't a simple generalisation since it will mean that the data has to contain the process indicator (maybe you have to add a column to the input table for this).

    (Please use [code][/code] tags to post code and stack traces.)


    • #3
      Is there any other way to implement parallel processing just by changing the configuration?
      If its not possible, is there any example of StagingItemReader implementation with Hibernate?


      • #4
        Standalone application


        I want to create a standalone application in my Spring project. Everytime the actual flow is happening, controller goes to Handler and the it's calling Dao class and retrieve the data and return to contoller's Model and View to its jsp.

        I want to create a standalone application directly connect the server. Everytime don't want to do the actual workflow.

        Please assist me in this and guide me anyone.