Commit Graph

2052 Commits

Author SHA1 Message Date
Philippe Marschall
f15edd414a Fix some raw types 2021-08-10 12:41:19 +02:00
Philippe Marschall
c9e06b2a7f Don't call wrapper constructors directly
The constructors of the wrapper classes for primitives (Double,
Integer, Long) have been deprecated since JDK 9 and should no longer be
called. Instead the static factory #valueOf should be used.
2021-08-10 11:54:25 +02:00
Philippe Marschall
1f3dd5f401 Replace Assert.assertThat with MatcherAssert.assertThat
Assert.assertThat is deprecated with MatcherAssert.assertThat as the
replacement.
2021-08-09 21:04:52 +02:00
Philippe Marschall
2aa94d09d1 Replace #initMocks with MockitoRule
Replace all references of MockitoAnnotations#initMocks with the
MockitoRule JUnit rule.
2021-08-09 18:33:39 +02:00
Henning Poettker
0ad68037b6 Reduce naming collisions in consecutive tests 2021-08-09 13:36:31 +02:00
Mahmoud Ben Hassine
83579cfbdf Extract charset name as constant in JdbcExecutionContextDao 2021-08-05 22:14:05 +02:00
Mahmoud Ben Hassine
a031637994 Add integration tests for all supported databases
Resolves #3092
2021-07-06 14:45:14 +02:00
Taeik Lim
4af4b05e33 Fix NPE in JobParameters.toProperties on null parameter value
Issue #834
2021-05-18 15:55:04 +02:00
Mark Bonnekessel
a43d3a5ab7 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:09:49 +02:00
Parikshit Dutta
58e82a56e7 Update SimpleStepBuilder to assign ItemProcessor lambda at construction
Issue #3749
2021-05-11 16:14:29 +02:00
Mahmoud Ben Hassine
7f0824b9da 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-05 16:20:28 +02:00
Mahmoud Ben Hassine
c4b001b732 Remove usage of deprecated APIs from testcontainers 2021-05-04 12:21:58 +02:00
Mahmoud Ben Hassine
b8a6a51488 Rename MySQLJdbcJobRepositoryTests to MySQLJdbcJobRepositoryIntegrationTests
Since this is a Docker based test, it should be part
of the integration test suite executed by
maven-failsafe-plugin during the `verify` phase.
2021-05-04 12:04:19 +02:00
Mahmoud Ben Hassine
5fbbad9888 Disable SSL usage in MySQL test container
By default, testcontainers does not use SSL. This commit
disable SSL usage in the datasource configuration to
prevent `SSLHandshakeException`s.
2021-05-04 11:21:33 +02:00
Marten Deinum
b7d144c10d 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 14:50:57 +01:00
siqqQ
a6f283b4a8 Change the value of the kind attribute to ref
Issue #1479
2021-03-02 17:39:07 +01:00
Mahmoud Ben Hassine
1d23d66e27 Add java.sql.Timestamp to trusted classes in Jackson serializer
Resolves #3855
2021-03-01 13:39:35 +01:00
Mahmoud Ben Hassine
602656a241 Polish contribution 58b2a7a2
* Update year in license headers
* Refactor test
2021-03-01 11:25:42 +01:00
Jagger
58b2a7a26b Add Arrays$ArrayList to trusted classes in Jackson serializer
Issue #3830
2021-03-01 11:24:19 +01:00
s.h.bae
f51ed50141 Fix javadoc on ItemReadListener interface
Found after reading some javadocs.
This seems to be a copy & paste mistake.
2021-02-19 13:56:42 +01:00
fhassak
4e02ce7daa Fix javadoc in ExitStatus 2021-02-19 10:21:58 +01:00
Mahmoud Ben Hassine
fc113be4a7 Temporarily ignore intermittently failing tests
This commit temporarily ignores tests that are failing
intermittently on Windows. A link to the corresponding
issue has been added to each test.

FTR, I tried to ignore those tests only on Windows by
using `Assume.assumeFalse(SystemUtils.IS_OS_WINDOWS);`
where `SystemUtils` is from `org.apache.commons.lang3`
but this assumption does not seem to work as expected.
2021-02-18 18:09:40 +01:00
Mahmoud Ben Hassine
eaeb415521 Remove outdated IDE specific resources 2021-02-05 16:40:47 +01:00
Mahmoud Ben Hassine
edc13ee0f0 Fix build on Java 11+ 2021-02-02 13:44:56 +01:00
Mahmoud Ben Hassine
d0493906a8 Replace usage of "build" directory with "target" 2021-01-29 11:45:34 +01:00
Mahmoud Ben Hassine
8cfec33ef0 Re-organize documentation resources
This commit also adds scaling diagrams [1]
to Figures.ppt. Those diagrams were not under
source control.

[1]: https://docs.spring.io/spring-batch/docs/current/reference/html/spring-batch-integration.html#externalizing-batch-process-execution
2021-01-29 11:45:31 +01:00
Mahmoud Ben Hassine
fa53dde01e Update build to use Maven instead of Gradle 2021-01-29 11:45:26 +01:00
Mahmoud Ben Hassine
236ee88dcf Merge spring-batch-core-tests in spring-batch-core 2020-12-04 16:03:58 +01:00
Mahmoud Ben Hassine
f8f5cf2fb4 Fix ignored tests 2020-12-03 17:35:23 +01:00
Mahmoud Ben Hassine
ac9a0d2718 Remove ignored test suites
Signed-off-by: Mahmoud Ben Hassine <mbenhassine@vmware.com>
2020-12-03 15:38:44 +01:00
Henning Poettker
b6c3fb6d8c Fix NullPointerException when creating job executions for job instances without executions 2020-11-26 16:27:42 +01:00
Mahmoud Ben Hassine
98fba4a03b 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.
2020-11-18 16:50:11 +01:00
Mahmoud Ben Hassine
cf2642223d 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
2020-11-18 16:50:10 +01:00
Mahmoud Ben Hassine
1090731302 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.
2020-11-18 16:50:10 +01:00
Mahmoud Ben Hassine
287eace69f Remove unused code in DecisionStepTests 2020-11-17 11:28:02 +01:00
Mahmoud Ben Hassine
f2c1296e7f 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 11:54:22 +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