Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Spring batch allows job without parameters to restart even if the job already completed successfully #4755

Open
Labels
Milestone
@fmbenhassine

Description

Discussed in #4694

Originally posted by ELMORABITYounes October 28, 2024
Right now even if a job was completed successfuly, spring batch allow It to be restarted if It contains no identifying params as shown here:

if (!identifyingJobParameters.isEmpty() 
		&& (status == BatchStatus.COMPLETED || status == BatchStatus.ABANDONED)) { 
	throw new JobInstanceAlreadyCompleteException( 
			"A job instance already exists and is complete for identifying parameters=" 
					+ identifyingJobParameters + ". If you want to run this job again, " 
					+ "change the parameters."); 
} 

I am wondering why is that done like this? I mean if the job already completed why It does not throw JobInstanceAlreadyCompleteException? Shouldn't second job instance without param considered the same and hence not allow It to be restarted if already succeeded?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /