• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring Batch Job seems to be starting one step before last one finishes?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am new to Spring Batch and hope someone can help me.

I have a simple job with three steps. The first steps does something with a file using a tasklet and then writes it back with a different name/extenstion. Step 2 is a chunk related reader/writer step that picks up this file, reads it with a multiresourceitemreader (so that I could use wildcards) and writes it to a database. Step 3 renames this file.

At first my job was implemented with step 2 only - works great. I then added the rename step - works fine. Then lastly I added step one...this is where the trouble starts. Step 1 on its own works...I can see the file being written back with the different extention. But step 2 now gives me a warning that there is no resources to be read. If then I comment out my tasklet code for step 1 (so the changed filename is still in the folder) and run the job again...then it does pick it up. So it almost seems as if Step 2 tries to find the file before it is written? Is this possible? Am I understanding batch correctly that one step has to complete before the next one start (in the way I wired it up?) Any ideas of what I can try to solve this?

Some code samples below.

Thanks




 
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doesn't step three actually rename the file to *_TEST.txt. So why do you expect step "2" to find such files?
Spring should execute the steps in order of the "next" specified on the step ...



 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic