spring-batch icon indicating copy to clipboard operation
spring-batch copied to clipboard

Can't run job a second time if empty list is passed as parameter the first time (Oracle)

Open nyg opened this issue 11 months ago • 6 comments

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

  1. Create a job with a parameter of type List
  2. Run the job with an empty list as argument
  3. 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://git.sr.ht/~nyg/example-java-spring-batch-bug

nyg avatar Jul 26 '23 17:07 nyg