Results 1 to 3 of 3

Thread: Entire Chunk Getting Skipped

  1. #1

    Question 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 at 10:17 PM. Reason: Inserting more information

  2. #2
    Join Date
    Sep 2008
    Location
    Chicagoland, IL
    Posts
    350

    Default

    What is your retry/skip configured as? Can you post the job's configuration?
    Michael Minella
    Spring Batch Lead
    Author - Pro Spring Batch
    http://www.michaelminella.com
    Twitter: @MichaelMinella

  3. #3

    Default

    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>

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •