Skip to content

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

Open
@nyg

Description

@nyg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    has: minimal-exampleBug reports that provide a minimal complete reproducible examplestatus: waiting-for-reporterIssues for which we are waiting for feedback from the reportertype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions