Commit Graph

2047 Commits

Author SHA1 Message Date
Mahmoud Ben Hassine
1199740407 Add java.util.UUID to trusted classes in Jackson serializer
This class is safe to deserialize according to Jackson:
https://github.com/FasterXML/jackson-databind/blob/master/src/main/java/com/fasterxml/jackson/databind/jsontype/impl/SubTypeValidator.java

This also has been checked against Jackson 2.11 to confirm
the backport of this enhancement to 4.3.x.

Resolves #4110
2022-05-17 11:34:00 +02:00
linhongcheng
fdd253a7e6 Fix retrieval of null job parameters of type long/double
Before this commit, a null job parameter of type long
or double was retrieved as 0L or 0.0. This caused
JobOperator.restart to create a new job instance
instead of restarting the previous failed execution.

This commit fixes how null job parameters of type
long or double are retrieved from the database to
correctly restart the same job instance.

Issue #4087
2022-04-28 18:04:06 +02:00
Mahmoud Ben Hassine
758372b025 Make BATCH_JOB_EXECUTION#JOB_CONFIGURATION_LOCATION nullable by default for DB2
This commit adds DEFAULT to BATCH_JOB_EXECUTION#JOB_CONFIGURATION_LOCATION
for DB2. This fixes a SqlSyntaxErrorException with DB2 v9.

Credits to @omheni for the fix, see #4002.

Resolves #4001
2022-04-14 16:35:59 +02:00
Mahmoud Ben Hassine
d8b8bab95b Update Xstream to version 1.4.19 2022-02-23 12:12:13 +01:00
Aaron
73bfaf3de4 Fix javadoc of FaultTolerantChunkProvider
FaultTolerantChunkProvider is an implementation
of ChunkProvider, not ChunkProcessor.

Issue #4029
2022-02-18 15:58:33 +01:00
Taeik Lim
b919921dbb Add @Nullable to StepExecution::getEndTime
Issue #4034
2022-02-18 15:02:21 +01:00
Philippe Marschall
4dddb10aa8 Make countStepExecutions access batch_job_execution only once
Change JdbcStepExecutionDao.COUNT_STEP_EXECUTIONS to access the
table batch_job_execution only once.

Issue #3876
2022-01-13 15:56:55 +01:00
Philippe Marschall
f689901254 Simplify GET_LAST_STEP_EXECUTION
Simplify JdbcStepExecutionDao#GET_LAST_STEP_EXECUTION
to use an equi-join instead of an cartesian join and
a subselect.

Issue #3997
2022-01-13 14:00:07 +01:00
Mahmoud Ben Hassine
74df41db72 Document default types of beans registered by EnableBatchProcessing
Resolves #3993
2022-01-12 00:33:13 +01:00
Henning Poettker
dab89ccb97 Adjust h2 schema to work with v2.0.x
Issue #4043
2022-01-10 10:17:58 +01:00
Philippe Marschall
5feea448d5 Make JobParameters#getParameters() immutable
Make  JobParameters#getParameters() immutable and avoid the defensive
copy.

Fixes #3980
2021-10-01 19:41:06 +02:00
Rémi Kaeffer
d6178d3e0e Fix double "the" typo everywhere in source code 2021-09-03 19:10:17 +02:00
tinh cao
55b47458b3 Remove whitespace to support multiple execution statement
Issue #3861
2021-09-03 11:36:47 +02:00
Mahmoud Ben Hassine
8ce37d1a4d Fix step execution retrieval in SimpleJobExplorer#getLastJobExecution
Before this commit, SimpleJobExplorer#getLastJobExecution returned
the last job execution without fetching its step executions and
their execution contexts.

This commit fixes the implementation to load the entire object
graph as done in SimpleJobExplorer#getJobExecution.

Resolves #3943 #3944
2021-08-27 14:05:57 +02:00
Taeik Lim
0f931188cb Fix NPE in JobParameters.toProperties on null parameter value
Issue #834
2021-05-18 16:14:50 +02:00
Mark Bonnekessel
0c4c660529 Override SimpleStepBuilder.faultTolerant() in FaultTolerantStepBuilder
Override SimpleStepBuilder.faultTolerant() in FaultTolerantStepBuilder
to prevent creation of a new FaultTolerantStepBuilder when calling
faultTolerant() on an existing FaultTolerantStepBuilder. Otherwise
configuration, like chunkListeners, are lost.

Issue #3840
2021-05-11 19:21:26 +02:00
Parikshit Dutta
a90389ff0d Update SimpleStepBuilder to assign ItemProcessor lambda at construction
Issue #3749
2021-05-11 18:42:42 +02:00
Mahmoud Ben Hassine
a5595bf9ee Fix job execution validation in SimpleJobRepository
Before this commit, the logic that validates if a job
instance is complete or not was based only on the size
of previous parameters, without checking if they are
identifying or not.

This commit introduces a change that uses only
identifying job parameters to identify a job instance
and validate its previous executions.

Issue #1221
2021-05-06 15:13:32 +02:00
Marten Deinum
737f6ace13 Added isXXXEnabled for logging statements
Guarded the logging statements which do concatenation of strings
or calling toString on objects. When a log level isn't enabled
this still would produce garbage that would need to be collected.

Guarded all logging up to info, warn and error can be assumed to be
enabled on a production system.
2021-03-17 15:01:41 +01:00
siqqQ
64e0bda5a4 Change the value of the kind attribute to ref
Issue #1479
2021-03-02 17:48:00 +01:00
Mahmoud Ben Hassine
82c1b05d53 Add java.sql.Timestamp to trusted classes in Jackson serializer
Resolves #3855
2021-03-01 13:50:13 +01:00
Mahmoud Ben Hassine
7838aeafad Polish contribution 58b2a7a2
* Update year in license headers
* Refactor test
2021-03-01 11:43:53 +01:00
Jagger
09c03ad367 Add Arrays$ArrayList to trusted classes in Jackson serializer
Issue #3830
2021-03-01 11:43:44 +01:00
s.h.bae
ff858d5908 Fix javadoc on ItemReadListener interface
Found after reading some javadocs.
This seems to be a copy & paste mistake.

(cherry picked from commit f51ed50141)
2021-02-23 12:12:17 +01:00
fhassak
be093e20b8 Fix javadoc in ExitStatus
(cherry picked from commit 4e02ce7daa)
2021-02-23 12:12:04 +01:00
Mahmoud Ben Hassine
b96ac3cb30 Fix PartitionParserTests
Some tests in PartitionParserTests were
failing intermittently due to the usage
of non-synchronized shared state between
concurrent threads.

This commit updates the test code to use
`AtomicInteger` instead of `int` for the
state shared between concurrent threads.

(cherry picked from commit 98fba4a03b)
2021-02-18 14:52:23 +01:00
Mahmoud Ben Hassine
c1fbed0007 Fix OptimisticLockingFailureTests#testAsyncStopOfStartingJob
This test was failing intermittently due to an incorrect
way of waiting for a job execution to finish, which is:

```
while(jobExecution.isRunning()) {
   // wait for async launched job to complete execution
}
```

`JobExecution#isRunning()` is based on the status
of the job execution in memory which might not be
persisted yet. Here is an excerpt from the Javadoc:

```
Test if this JobExecution indicates that it is
running. It should be noted that this does not
necessarily mean that it has been persisted as
such yet.
```

That's why in the case where `isRunning` returns
false and the JobExecution is not persisted yet
(which is still in a running status in db),
the second attempt of re-running the job fails
with a `JobExecutionAlreadyRunningException`.

This commit fixes the loop by continuously
checking the status of the Job execution
in the job repository until it reaches one
of the end statuses.

Issue #1121

(cherry picked from commit cf2642223d)
2021-02-18 14:51:58 +01:00
Mahmoud Ben Hassine
4fefe4c101 Fix flaky tests
JsrSplitParsingTests#test and DecisionStepTests#testDecisionAfterSplit
were failing intermittently with:

```
org.springframework.batch.core.JobExecutionException: Flow execution ended unexpectedly
    at org.springframework.batch.core.jsr.job.flow.JsrFlowJob.doExecute(JsrFlowJob.java:88) ~[main/:?]
    at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:320) [main/:?]
    at org.springframework.batch.core.jsr.launch.JsrJobOperator$2.run(JsrJobOperator.java:674) [main/:?]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
Caused by: org.springframework.batch.core.job.flow.FlowExecutionException: Ended flow=flow1.step1 at state=flow1.step1.flow1.step1 with exception
    at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:178) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:94) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:91) ~[main/:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_232]
    ... 1 more
Caused by: org.springframework.dao.ConcurrencyFailureException: PreparedStatementCallback; SQL [INSERT INTO BATCH_STEP_EXECUTION_CONTEXT (SHORT_CONTEXT, SERIALIZED_CONTEXT, STEP_EXECUTION_ID) VALUES(?, ?, ?)]; transaction rollback: serialization failure; nested exception is java.sql.SQLTransactionRollbackException: transaction rollback: serialization failure
    at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:73) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1541) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:667) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:960) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:1015) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.persistSerializedContext(JdbcExecutionContextDao.java:236) ~[main/:?]
    at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.saveExecutionContext(JdbcExecutionContextDao.java:189) ~[main/:?]
    at org.springframework.batch.core.repository.support.SimpleJobRepository.add(SimpleJobRepository.java:177) ~[main/:?]
    at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:371) ~[spring-tx-5.3.0.jar:5.3.0]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:134) ~[spring-tx-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) ~[spring-aop-5.3.0.jar:5.3.0]
    at com.sun.proxy.$Proxy41.add(Unknown Source) ~[?:?]
    at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:144) ~[main/:?]
    at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:68) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:68) ~[main/:?]
    at org.springframework.batch.core.jsr.job.flow.support.state.JsrStepState.handle(JsrStepState.java:53) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:169) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:94) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:91) ~[main/:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_232]
    ... 1 more
Caused by: java.sql.SQLTransactionRollbackException: transaction rollback: serialization failure
    at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.jdbc.JDBCPreparedStatement.executeUpdate(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136) ~[commons-dbcp2-2.8.0.jar:2.8.0]
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136) ~[commons-dbcp2-2.8.0.jar:2.8.0]
    at org.springframework.jdbc.core.JdbcTemplate.lambda$update$2(JdbcTemplate.java:965) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:651) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:960) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:1015) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.persistSerializedContext(JdbcExecutionContextDao.java:236) ~[main/:?]
    at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.saveExecutionContext(JdbcExecutionContextDao.java:189) ~[main/:?]
    at org.springframework.batch.core.repository.support.SimpleJobRepository.add(SimpleJobRepository.java:177) ~[main/:?]
    at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:371) ~[spring-tx-5.3.0.jar:5.3.0]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:134) ~[spring-tx-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) ~[spring-aop-5.3.0.jar:5.3.0]
    at com.sun.proxy.$Proxy41.add(Unknown Source) ~[?:?]
    at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:144) ~[main/:?]
    at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:68) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:68) ~[main/:?]
    at org.springframework.batch.core.jsr.job.flow.support.state.JsrStepState.handle(JsrStepState.java:53) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:169) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:94) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:91) ~[main/:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_232]
    ... 1 more
Caused by: org.hsqldb.HsqlException: transaction rollback: serialization failure
    at org.hsqldb.error.Error.error(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.error.Error.error(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.Session.handleAbortTransaction(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.Session.executeCompiledStatement(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.Session.execute(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.jdbc.JDBCPreparedStatement.executeUpdate(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136) ~[commons-dbcp2-2.8.0.jar:2.8.0]
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136) ~[commons-dbcp2-2.8.0.jar:2.8.0]
    at org.springframework.jdbc.core.JdbcTemplate.lambda$update$2(JdbcTemplate.java:965) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:651) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:960) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:1015) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.persistSerializedContext(JdbcExecutionContextDao.java:236) ~[main/:?]
    at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.saveExecutionContext(JdbcExecutionContextDao.java:189) ~[main/:?]
    at org.springframework.batch.core.repository.support.SimpleJobRepository.add(SimpleJobRepository.java:177) ~[main/:?]
    at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:371) ~[spring-tx-5.3.0.jar:5.3.0]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:134) ~[spring-tx-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) ~[spring-aop-5.3.0.jar:5.3.0]
    at com.sun.proxy.$Proxy41.add(Unknown Source) ~[?:?]
    at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:144) ~[main/:?]
    at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:68) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:68) ~[main/:?]
    at org.springframework.batch.core.jsr.job.flow.support.state.JsrStepState.handle(JsrStepState.java:53) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:169) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:94) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:91) ~[main/:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_232]
    ... 1 more
```

This failure is due to a concurrency issue when executing
the split flow with the default SimpleAsyncTaskExecutor.

Several attempts have been made to fix this issue with no success:

* use `@DirtiesContext` annotation
* use a separate db for each test
* use `READ_COMMITTED` isolation level in the job repository
* downgrade hsqldb from v2.5.1 to v2.4.1 (since v2.5.1 has
introduced several changes in the MVCC mode)

The issue seems to be related to how the in-memory database
is shared between tests *and* how the test context is cached
(ie the combination of both).

This commit moves these tests to a separate test class which
seem to fix the issue.

(cherry picked from commit 1090731302)
2021-02-18 14:51:36 +01:00
Mahmoud Ben Hassine
8f110d6d4f Remove unused code in DecisionStepTests
(cherry picked from commit 287eace69f)
2021-02-18 14:50:55 +01:00
Henning Poettker
18ae02ab02 Fix NullPointerException when creating job executions for job instances without executions 2020-11-26 16:34:01 +01:00
Mahmoud Ben Hassine
9f39449bb0 Fix ClassCastException in RunIdIncrementer
Before this commit, the RunIdIncrementer was failing
with a ClassCastException if the run.id parameter is
not passed as a Long.

This commit makes the RunIdIncrementer more liberal
in what it accepts by trying to parse the parameter
to a Long.

Resolves #3799
2020-11-09 12:06:31 +01:00
Mahmoud Ben Hassine
791cfd5e8a Polish 0c500794f6
This commit adds a test case for building a flow
job with a job-scoped step.

Issue #857
2020-10-27 14:40:39 +01:00
Artyom Gabeev
0c500794f6 Do not call getName on step/flow - they may be Job/Step scoped proxies
Resolves #857
2020-10-27 13:45:41 +01:00
Mahmoud Ben Hassine
a0bcd7ce45 Add ability to amend trusted classes in Jackson2ExecutionContextStringSerializer
This commit adds the ability to specify additional trusted
classes without having to provide a custom object mapper.

Issue #3765
2020-10-16 11:36:18 +02:00
Mahmoud Ben Hassine
75de738b04 Deprecate SQLFire support
SQLFire was announced [1] to be in EOL as of November 1st, 2014.
This commit marks SQL scripts for SQLFire as deprecated and
scheduled for removal in v5.

[1]: https://www.vmware.com/latam/products/pivotal-sqlfire.html

Resolves #815
2020-09-30 16:20:58 +02:00
Mahmoud Ben Hassine
342a1a35dc Document usage of non-identifying job parameters
Resolves #3633
2020-09-24 10:10:29 +02:00
Mahmoud Ben Hassine
b079805353 Deprecate ScheduledJobParametersFactory
This commit deprecates ScheduledJobParametersFactory
in favor of DefaultJobParametersConverter.

Resolves #3781
2020-09-16 21:00:25 +02:00
Mahmoud Ben Hassine
0958cf4f3d Deprecate the Map-based JobRepository and JobExplorer
This commit deprecates the Map-based JobRepository
and JobExplorer factory beans with the associated
DAOs in favor of using the JDBC-based implementations
with an in-memory database.

Resolves #3780
2020-09-16 14:47:05 +02:00
Mahmoud Ben Hassine
982ad7d5e9 Deprecate JobExecution#stop
Calling jobExecution#stop manually is prone to
forgetting to save the job execution in the job
repository.

The way to request a job execution to stop is
by using JobOperator#stop or by using the
CommandLineJobRunner with the "-stop" option.
Both will correctly set the status to STOPPING
and update the job execution in the repository.

Resolves #1605
2020-09-15 13:54:23 +02:00
Michael Minella
b708dfb025 Updates for GraalVM
This commit updates all places where Spring Batch uses an @Configuration
annotation to no proxy bean methods. This is needed for GraalVM support.
2020-09-08 21:54:24 +02:00
Mahmoud Ben Hassine
744d1834fe Add support for annotation based listeners in JobBuilder
Resolves #817
2020-08-21 10:31:03 +02:00
Mahmoud Ben Hassine
a333c16459 Add JobParametersIncrementer implementation based on a DataFieldMaxValueIncrementer
Issue #1521
2020-08-11 21:13:20 +02:00
Mahmoud Ben Hassine
ac485ee326 Tag spring.batch.job.active metric with the job name
Resolves #3750
2020-07-24 12:20:43 +02:00
Mahmoud Ben Hassine
9a79b4572d Update Jackson2ExecutionContextStringSerializer 2020-06-10 20:11:08 +02:00
Yanming Zhou
28768dc0c6 Support microsecond accuracy for MySQL
see 320cce6446
2020-05-15 11:13:28 +02:00
Yanming Zhou
1322f91492 Improve performance in JdbcStepExecutionDao
It's similar to cafd35c95f
2020-05-15 09:36:25 +02:00
Parikshit Dutta
320cce6446 Updated MySQL DDL and Added Migration Script for v4.3 2020-05-12 16:32:17 +02:00
Maxim Cheban
cafd35c95f Improve performance in JdbcStepExecutionDao
Optimize SQL in GET_LAST_STEP_EXECUTION to work fast on large amount of records in %PREFIX%JOB_EXECUTION table
2020-04-25 06:53:20 +02:00
Baris Cubukcuoglu
b50c665f04 Add method StepExecutionDao.countStepExecutions to eliminate for-loop in SimpleJobRepository.getStepExecutionCount
Resolves #3657
2020-04-24 07:08:46 +02:00
Mahmoud Ben Hassine
6cca32fde0 Fix metrics collection in FaultTolerantChunkProcessor
Before this commit, metrics were not collected in a fault-tolerant step.
This commit updates the FaultTolerantChunkProcessor to collect metrics.

For the record, chunk scanning is not covered for two reasons:

1. When scanning a chunk, there is a single item in each write operation,
so it would be incorrect to report a metric called "chunk.write" for a
single item. We could argue that it is a singleton chunk, but still..
If we want to time scanned (aka individual) items, we need a more fine
grained timer called "scanned.item.write" for example.

2. The end result can be confusing and might distort the overall metrics
view in case of errors (because of the noisy metrics of additional transactions
for individual items).

As a reminder, the goal of the "chunk.write" metric is to give an overview
of the write operation time of the whole chunk and not to time each item
individually (this could be done using an `ItemWriteListener` if needed).

Resolves #3664
2020-03-31 16:37:12 +02:00