When a tasklet is declared with xml using the shortcut version, the
MethodInvokingTaskletAdapter that is created automatically does not
address passing parameters expected by Tasklet#execute (which is
incorrect since the documentation of the schema attribute "method"
says the bean should define a method with the same signature).
This commit fixes parameters passing when using the shortcut version.
Resolves BATCH-2397
I made a new implementation of the XML/Java toggle (and added a third choice for having both available).
Changes to make a dynamic ToC work with content selection toggles
Various asciidoc and JavaScript changes to make the dynamic ToC (tocbot) work with the content toggle (XML or Java in this case but also more options in other projects).
Before this commit, the filter count of the contribution was applied
for each item of a scanned chunk. For example, with a chunk of 30,
if the filter count is 10 and an item is skipped during write, then the
filter count is equal to 210 (10 + 20 * 10).
If this commit is applied, the filter count will be re-initialized when
scanning the chunk.
Resolves BATCH-2663
Before this commit, when a job execution is stopped from a different
JVM than the one running the job, a warning says that the job cannot
be found. This was confusing to some users since the job can be found
in the database (but is actually not defined in the job registry of
the application context of the second JVM).
After this commit is applied, the warning will be more explicit to
inform the user that the job cannot be found in the job registry
(to not be confused with the database)
Resolves BATCH-2667
In order to convert a String value to a Date, The `DefaultConversionService`
uses the constructor `java.util.Date(java.lang.String)` behind the scene
(from `org.springframework.core.convert.support.ObjectToObjectConverter.convert`).
This constructor throws a `java.lang.IllegalArgumentException` for values in
CET timezone, for example: "Thu Jan 04 09:05:50 CET 2018".
This commit updates the failing test to use a fixed timezone (UTC).
Resolves BATCH-2668
Spring 4 requires JDK 6 which includes JAXP 1.4. In Spring 4
`org.springframework.util.xml.StaxUtils` is public and directly
delegates to `javax.xml.transform.stax.StAXSource`. This means that
`org.springframework.batch.item.xml.StaxUtils#hasSpring30StaxSupport`
will always be true. Therefore a lot of code an be simplified by
calling the constructors directly instead of through reflection.
- remove reflection no longer needed in Spring 4
- move methods only used in tests to custom test class
Issue: BATCH-2417
DelimitedLineTokenizer was refactored to improve its performance but its behavior was also slightly changed.
When the input is an empty csv string with double quotes, e.g. the java
String line = "\"\""; the tokenizer returns the same String, whereas
before it was returning an empty string.
This is due to the condition checking for quotes to remove not stripping
the double quotes from the empty csv string (because its length is 2 and
the code check for strictly greater than 2).
The previous code is there 973fe44d6c/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/DelimitedLineTokenizer.java (L202) and checking for
double quotes at the start and end of the string without special
handling for the empty string.
At test is also added to ensure this won't break again.
Resolves BATCH-2657
Add support for DB2AS400 to DefaultDataFieldMaxValueIncrementerFactory.
Apparently, DB2AS400 is using the same syntax for sequence value
retrieval as standard DB2.
resolves BATCH-2525
In order to make the Map based JobRepository threadsafe, the
JobExecutino was modified to use a `CopyOnWriteArraySet` for the
collection backing the child `StepExecution` collection. However, this
collection option has bad performance characteristics when used with
large collections. When using partitioning, it can be common to have a
large number of `StepExecution` instances to add which drastically hurts
start up time.
This commit remove the use of the `CopyOnWriteArraySet` for the
`JobExecution#stepExecutions` and replaces it with a `LinkedHashSet`
wrapped via `Collection.synchronizedSet`.
Resolves BATCH-2384
Why:
Listeners should be called in normal order before some event
(i.e. read, write) and after that event in reverse order.
Side effects:
The ordering of Chunk and ItemReader Listeners is changed and will
change some behaviors of users. This change is still neccesary because
it is not only the correct and obviouse way, but also prevents new
users to hack around this problem.
This commit adds two small tweaks to the testing.adoc that demonstrates
how to import java based configuration into a unit test (instead of
importing XML based configurations).
I removed extraneous white space from non-code lines and arranged the non-code lines to be as close to 90 characters as possible. I also edited the new content.
Applied code review changes