Results 1 to 2 of 2

Thread: Verify that each iteration is commited in a step

  1. #1
    Join Date
    Oct 2005
    Location
    Bergen, Norway
    Posts
    128

    Default Verify that each iteration is commited in a step

    hi!

    I've got a step like this:

    <bean id="historicalizationStep" class="org.springframework.batch.core.step.item.Sk ipLimitStepFactoryBean">
    <property name="retryableExceptionClasses" value="org.springframework.dao.ConcurrencyFailureE xception" /> <!-- retry deadlocks -->
    <property name="retryLimit" value="3" /> <!-- but maximum 3 times -->
    <property name="commitInterval" value="1" />
    <property name="transactionManager" ref="transactionManager" />
    <property name="jobRepository" ref="jobRepository" />
    <property name="listeners">
    <ref local="historicalizationKeyCollector" />
    </property>
    <property name="itemReader">
    <bean class="com.mycompany.services.history.jobs.Histori calizationItemReader">
    <property name="delegate" ref="historicalizationDrivingQueryItemReader" />
    <property name="someEntityDao" ref="someEntityDao" />
    </bean>
    </property>
    <property name="itemWriter">
    <bean class="org.springframework.batch.item.support.Comp ositeItemWriter">
    <property name="delegates">
    <list>
    <bean class="org.springframework.batch.item.database.Hib ernateAwareItemWriter">
    <property name="sessionFactory" ref="historicSessionFactory" />
    <property name="delegate">
    <bean class="com.mycompany.services.history.jobs.Histori calizationItemWriter">
    <property name="historicSomeEntityDao" ref="historicEntitySomeDao" />
    </bean>
    </property>
    </bean>
    <bean class="com.mycompany.services.jobs.DeleteSomeentit yItemWriter">
    <property name="historicalizationSomeEntityDao" ref="someEntityJdbcDao" />
    </bean>
    </list>
    </property>
    </bean>
    </property>
    <property name="streams">
    <ref local="historicalizationDrivingQueryItemReader" />
    </property>
    </bean>


    I want to verify that each iteration (that is for each key delivered by historicalizationKeyCollector) of this step is commited.

    Is there any way to verify this? Anything to search for in the logs?

    so that in pseudo it works like this:

    init: fetch keys (X, Y, Z)

    tran begin
    get key X
    read item for X in active
    write item for X in historic
    delete item X in active
    tran commit

  2. #2
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    Depending on how you configure your logs, you can get the transaction begin and end information (basically chunk boundaries in spring batch lingo) However, what you're looking for in between is really application specific. I would use a listener to add that type of logging.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •