Skip to content

Instantly share code, notes, and snippets.

@scottmarlow
Created September 18, 2013 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottmarlow/6603746 to your computer and use it in GitHub Desktop.
Save scottmarlow/6603746 to your computer and use it in GitHub Desktop.
JSR352 (batch) section 11.6 Regular Chunk Processing
1.
<Create StepContext>
2.
<Store step level properties in StepContext>
3.
<->[StepListener.beforeStep...] // thread A
4.
[<begin transaction> ]
5.
<->ItemReader.open // thread A
6.
<->ItemWriter.open // thread A
7.
[<commit transaction> ]
8.
// chunk processing:
9.
<repeat until no more items> {
a. <begin checkpoint [<begin transaction> ]>
b. <repeat until commit criteria reached> {
i. <->ItemReader.readItem // thread A
ii. <->ItemProcessor.processItem // thread A
iii. <add item to buffer>
c. }
d. <->ItemWriter.writeItems // thread A
e. <->[ItemReader.checkpointInfo] // thread A
f. <->[ItemWriter.checkpointInfo] // thread A
g. <Store StepContext persistent area>
h.
i. <commit checkpoint (commit transaction)>
10.
}
11.
[<begin transaction> ]
12.
<->ItemWriter.close // thread A
13.
<->ItemReader.close // thread A
14.
[<commit transaction> ]
15.
<->[StepListener.afterStep...] // thread A
16.
<Store StepContext persistent area>
17.
<Destroy StepContext>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment