Announcement Announcement Module
Collapse
No announcement yet.
ItemCount and skipcount Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ItemCount and skipcount

    How the itemcount, skipcount and rollbackcount will work in case of using HibernateAwareItemWriter ? Is this different from the normal JDBC scenario?

    I have four parent records and a few children records for each parent.
    Three children for first two parents and one each for remaining two parents.
    Suppose if failure occurs for a child insertion of second parent record(all other records are fine), all other three parent records and its children will be inserted into tables.

    I've commit interval of 3. Using JDBC writer, i got itemcount as 4 and skipcount as 1. This is fine.
    But when i used HibernateAwareItemWriter, i got itemcount as 7 and skipcount as 1. This happens for the first run after starting the server(batch is running on a app server). If i run the same scenario (with out server restart), i am getting the values 4 and 1.

    Would anybody please tell me why this mismatch ?
    Should i add anything more in HibernateAwareItemWriter ?
    My writer def in job.xml looks like this:

    Code:
    <bean id="hibernateItemWriter"
            class="org.springframework.batch.item.database.HibernateAwareItemWriter">
        <property name="sessionFactory" ref="sessionFactory" />
        <property name="delegate" ref="customDelegateWriter" />
      </bean>
    
    	<bean id="customDelegateWriter" class="com.DelegateWriter">
    		<property name="delegate" ref="customWriter" />
    	</bean>
    	
    	<bean id="customWriter"
    		class="com.CustomWriter">
    		<property name="childDao" ref="childDao" />
    	</bean>
    Last edited by johny_z; Nov 6th, 2008, 12:23 AM.
Working...
X