Results 1 to 2 of 2

Thread: [ChunkListener] afterChunk() is called before the Writer is called

  1. #1

    Exclamation [ChunkListener] afterChunk() is called before the Writer is called

    Hello,

    I currently have a problem with spring batch 2.0.0 RC1. I have implemented a listener extending StepListenerSupport and implementing all listener methods so I can see in witch order they are called. The actual order is:

    Code:
    Before Step
    
    Before Chunk
    Before Read After Read: 1
    Before Read After Read: 2
    Before Read: After Read: 3
    After Chunk
    Before Write: [1, 2, 3] After Write: [1, 2, 3]
    After Step
    This is not what I would have expected. Based on what I read in the documentation(chapter 5.1.10.2. ChunkListener "Conversely, afterChunk is called after the last call to write on the ItemWriter, but before the chunk has been committed.") I assumed the order has to be:

    Code:
    Before Step
    
    Before Chunk
    Before Read After Read: 1
    Before Read After Read: 2
    Before Read: After Read: 3
    Before Write: [1, 2, 3] After Write: [1, 2, 3]
    After Chunk
    After Step
    Is the actual behavior intended or is it a bug?

    Best regards,
    Christof

  2. #2
    Join Date
    Jun 2005
    Posts
    4,232

Posting Permissions

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