Mar 31st, 2010, 07:42 PM
Job not restarting on the line number expected
I am encountering a strange problem during the job restart. This is happening in one of the strange scenarios and i am not able to figure out the root cause of the problem.
I am reading from a flat file, processing it and inserting into database using the itemwriter. I am skipping the records irrespective of the exception thrown and the skip-limit has been set to 1000. The commit interval is set to 10.
Once the skip limit is reached the job is terminated. When i restart the job it is not starting at the point as expected. It starts two rows ahead from where it is expected to start from.
For example if the job terminates at row number 210. When I restart the job it is supposed to start reading from row 211. But it starts from row number 213. However if i set the commit interval to 1 it restarts from where it is expected to start from. This is happening only for this particular scenario and hence i am finding it difficult to isolate the problem. Has anyone encountered this problem before or am i doing something wrong?
Thanks in advance.
Apr 2nd, 2010, 01:49 AM
Is the error happening in the writer?
Apr 2nd, 2010, 08:38 AM
Yes the error is happening in the writer.
Apr 3rd, 2010, 06:12 AM
We are also investigating weird behavior when the exception is thrown in the writer. I am not sure whether it's a bug in the framework or a bad usage of it, really.
Why is the error thrown in the writer in the first place? Can't you generate the error in the processor instead?
Apr 3rd, 2010, 08:04 AM
nopes I cannot do that. I am calling some external apis to insert into the database. So it is quiet possible that these apis might throw exceptions due to various reasons like data integrity etc.
It seems to be a bug in the framework because i am doing nothing special. let me know in case you find the exact cause of the problem.
Thanks in advance.