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:
<property name="sessionFactory" ref="sessionFactory" />
<property name="delegate" ref="customDelegateWriter" />
<bean id="customDelegateWriter" class="com.DelegateWriter">
<property name="delegate" ref="customWriter" />
<property name="childDao" ref="childDao" />