Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a spring batch "job" scope?

I just want to know if there is a "JOB" scope in spring batch, like the "STEP" scope ? If there is not, should we develop our custom scope, or is there a better alternative ?

Thanks in advance.

like image 716
Oussama Zoghlami Avatar asked Sep 10 '12 14:09

Oussama Zoghlami


People also ask

Can a Spring Batch have multiple jobs?

Multiple jobs can be run simultaneously. There are two main types of Spring Batch Parallel Processing: Single Process, Multi-threaded, or Multi-process. These are also divided into subcategories, as follows: Multi-threaded Step (Step with many threads, single process)

What is job and step in Spring Batch?

A Step is an independent, specific phase of a batch Job , such that every Job is composed of one or more Step s. Similar to a Job , a Step has an individual StepExecution that represents a single attempt to execute a Step .

What is the benefit of Spring Batch?

Spring Batch provides reusable functions that are essential in processing large volumes of records, including logging/tracing, transaction management, job processing statistics, job restart, skip, and resource management.


2 Answers

Finally Spring Batch 3.0 supports now the Job Scope : What's new in Spring Batch 3.0

like image 42
Oussama Zoghlami Avatar answered Sep 29 '22 01:09

Oussama Zoghlami


A jira has been opened some times ago on the spring batch issues tracker regarding this issue: https://jira.springsource.org/browse/BATCH-1701

A pull request has been submitted as well, hopefully it will be merge soon, because I have this use case too: https://github.com/SpringSource/spring-batch/pull/41

There are multiple workarounds in the mean time, each with its drawback, see this answer on stackoverflow: https://stackoverflow.com/a/8121102/470107

like image 165
Raphaël Brugier Avatar answered Sep 29 '22 03:09

Raphaël Brugier