spring-projects / spring-projects/spring-batch
Can't run job a second time if empty list is passed as parameter the first time (Oracle)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 2.5k
- Avg merge
- 6d 53m
- Merged PRs (30d)
- 3
Description
Bug description
When a job has a parameter of type java.util.List and the job is run with an empty list and the database is Oracle, it is not possible to run the job a second time.
The exception java.lang.IllegalArgumentException: value must not be null will be thrown by JobParameter because it is trying to convert null into a List. The null values comes from the fact that empty strings are the same thing as null for Oracle database (the empty string being the serialised empty list).
Environment
- Spring Batch 5.0.2
- Java 17
- Oracle database
Steps to reproduce
- Create a job with a parameter of type List
- Run the job with an empty list as argument
- Run the job a second time (with any value as argument)
Expected behavior
It should be possible to run such a job an infinite number of times.
Minimal Complete Reproducible example
https://github.com/nyg/example-spring-batch-bug
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal complete reproducible example and trace how JobParameter converts the serialized empty list when the job parameters are read from Oracle. Confirm the failure after the first empty-list run, then verify that subsequent runs with another list value succeed repeatedly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100