Commit Graph

2063 Commits

Author SHA1 Message Date
Mahmoud Ben Hassine
e022216e10 Fix JavaDoc in JobBuilder
Issue #4415
2023-11-20 11:59:30 +01:00
Taeik Lim
b736cd4e28 Prevent race condition when flow transition is not initialized
Resolves #4092
2023-08-22 16:00:55 -07:00
Kim Seon Woo
7f13c5323f Fix javadoc of SimpleStepBuilder
Resolves #4402

Author: Seon Woo Kim <seronwoo960000.kim@gmail.com>
2023-07-17 09:57:43 +02:00
Mahmoud Ben Hassine
9251add879 Refine contribution #4364
Add integration test

Related to #4246
2023-05-16 08:10:29 +02:00
jinwoo-Bae
539ec71ed7 Fix retrieval of job parameters in SimpleJobExplorer#getJobExecutions
Before this commit, SimpleJobExplorer#getJobExecutions returned
job executions with wrong job parameters, ie a job execution could
have the parameter of another execution.

This commit fixes the implementation so that each returned job
execution has its own parameters.

Resolves #4246
2023-05-16 08:01:09 +02:00
Mahmoud Ben Hassine
81e619b433 Improve performance of JdbcJobInstanceDao#getLastJobInstance
Credit to @chenglongyan for the fix

Backport of 30ce3326d1

Issue #4024
2023-03-29 12:06:47 +02:00
Henning Poettker
c68da18d3e Improve step execution polling and retrieval
Resolves #3790
2023-02-22 09:45:50 +01:00
Stephan Freund
bd43ca1007 Fix TARGET_NAME_PREFIX in StepScope
Resolves #3936
2023-02-21 11:48:56 +01:00
Philippe Marschall
900b36f604 Use ExecutionContext map constructor
Use ExecutionContext map constructor to simplify
ExecutionContextRowMapper.mapRow.

Issue #3985
2023-02-13 16:51:55 +01:00
Philippe Marschall
097891fbfb Optimize ExitStatus#addExitDescription
Optimize ExitStatus#addExitDescription by reducing string allocations
through:

- avoid string allocation when the current description is empty
- avoid string allocation when the given description is empty
- avoid intermediate string allocation by allocating the correct buffer size

Issue #3979
2023-02-13 14:42:49 +01:00
Marvin Deng
8a77ca3be3 Upgrade job execution status from STOPPING to STOPPED if it has already ended
Resolves #4064
2022-11-18 16:48:00 +01:00
Henning Poettker
6b51408769 Fix non-nullable columns in MySQL migration for Spring Batch 4.3
Issue #4145
2022-08-24 15:59:46 +02:00
Taeik Lim
f6fc7c7825 Add missing initialized flag set to FlowJob
Issue #4142
2022-07-20 18:53:11 +02:00
Mahmoud Ben Hassine
0d7a16054c Fix annotation based listener registration in FaultTolerantStepBuilder
Resolves #4137
2022-06-22 11:42:31 +02:00
Taeik Lim
976d7916ad Add @Nullable where appropriate in JobExecution and StepExecution
Issue #4077
2022-05-18 11:45:19 +02:00
Mahmoud Ben Hassine
c2a502830d Add javax.xml.namespace.QName 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 #4044
2022-05-17 15:36:10 +02:00
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