Announcement Announcement Module
Collapse
No announcement yet.
[ChunkListener] afterChunk() is called before the Writer is called Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • [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
    That's a bug. Thanks: http://jira.springframework.org/browse/BATCH-1111

    Comment

    Working...
    X