Announcement Announcement Module
No announcement yet.
ItemCount and skipcount Page Title Module
Move Remove Collapse
Conversation Detail Module
  • 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:

    <bean id="hibernateItemWriter"
        <property name="sessionFactory" ref="sessionFactory" />
        <property name="delegate" ref="customDelegateWriter" />
    	<bean id="customDelegateWriter" class="com.DelegateWriter">
    		<property name="delegate" ref="customWriter" />
    	<bean id="customWriter"
    		<property name="childDao" ref="childDao" />
    Last edited by johny_z; Nov 5th, 2008, 11:23 PM.