Announcement Announcement Module
Collapse
No announcement yet.
Entire Chunk Getting Skipped Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Entire Chunk Getting Skipped

    Hi,

    I am writing 10 items, in chunks of 3 each.
    Configuration:
    • Oracle 11g enterprise
    • Transaction propogation=REQUIRED
    • Skip all exceptions (java.lang.exception)
    • Reader is JdbcCursorItemReader
    • Item #3 is a delibrate failure, which will throw an exception.

    Expected Result
    • Item #1 and Item #2 from Chunk #1 will get written.
    • Item #3 will fail insert, causing Chunk #1 to Roll back.
    • Spring Batch will trigger the writer 3 times separately for Item #1, Item #2 and Item #3
    • Item #3 will again fail insert and will be skipped.

    Actual Result
    • Chunk #1 is getting rolled back; BUT; is not retried again.
    • Job Continues and writes Chunk #2,Chunk #3 and Chunk #4


    The above behaviour is not observed when i try on Oracle XE; (with the same codeset); in this case, the expected outcome is observed.

    Any particular configuration needs to be applied to Oracle 11g ?

    [Meta Information]
    BATCH_STEP_EXECUTION
    Commit_COUNT=2, READ_COUNT=10, WRITE_COUNT=7, ROLLBACK_COUNT=1, EXIT_CODE=COMPLETED

    Regards,
    Pravin
    Last edited by prabhu.pravin; Nov 11th, 2012, 11:17 PM. Reason: Inserting more information

  • #2
    What is your retry/skip configured as? Can you post the job's configuration?

    Comment


    • #3
      Hi,

      The job is configured as below (cannot post the exact code here)
      Code:
       <batch:job id="job1" job-repository="jobRepository" restartable="true">
      
          <batch:step id="step1">
      
           <batch:tasklet>
              <batch:chunk reader="itemReader" writer="itemWriter" commit-interval="3" skip-limit="100">
      
                 <batch:skippable-exception-classes>
                     <batch:include class="java.lang.Exception"/>
                 </batch:skippable-exception-classes>       
              </batch:chunk>
      
           </batch:tasklet>
          </batch:step>
      
       </batch:job>

      Comment

      Working...
      X