Skip to content

When running the tutorial, SELECT from the database happens before INSERT #8

Closed
@davidmoore-at-edge

Description

@davidmoore-at-edge

Hi there,

I'm brand new to Spring Batch, so I was following the tutorial at https://spring.io/guides/gs/batch-processing/ and it made sense for the most part. However, when I got to the point of actually running the code, I noticed that I was only seeing the output for when the data was processed, e.g.

Converting (firstName: Jill, lastName: Doe) into (firstName: JILL, lastName: DOE)

but not for when the data was read from the internal database, e.g.

Found <firstName: JILL, lastName: DOE> in the database.

This occurred regardless of whether I used "gradlew bootRun" or "gradlew build" followed by "java -jar build/libs/gs-batch-processing-0.1.0.jar." After adding in some debug statements, it appeared to me that the SELECT statement in Application.run() was getting called before the INSERT statements of BatchConfiguration.writer().

Do you have any suggestions for why this is happening?

In case it matters, I'm using Java version 1.8.0_20 on Windows 7 64-bit.

Thank you for any help you can provide!
David

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions