Skip to content

Support RetryOperations within SimpleJobRepository [BATCH-1329] #2251

@spring-projects-issues

Description

@spring-projects-issues

Ian Brandt opened BATCH-1329 and commented

See the referenced forum post for motivation and details. If SimpleJobRepository had a get/setRetryOperations that was used to wrap all DAO calls it would have a very flexible and durable way to deal with transient failures such as CannotSerializeTransactionException (which is to be anticipated given the default transaction SERIALIZABLE isolation level set by AbstractJobRepositoryFactoryBean). Of course AbstractJobRepositoryFactoryBean would need equivalent getters and setters, and in the absence of given configuration would set a default. The default could be a RetryTemplate with the NeverRetryPolicy to preserve current behavior, or one could get fancy and start handling given TransientDataAccessException subclasses with an ExceptionClassifierRetryPolicy. The latter would require the determination of sensible defaults. I'm not sure if that would result in endless back and forth by users with different needs, or if a "retry 3 times with 1-2 second pause" would be a generally welcomed default?

Per Dave's post earlier in the referenced forum thread an alternative would be put it on the user to wrap the JobLauncher with RetryOperations. Given that transient failures can be anticipated for JobRepository in particular I think it would be better to handle them at a lower level out of the box (i.e. I'm in favor of a default that's more robust than NeverRetryPolicy). Perhaps there is a case to add RetryOperations to SimpleJobLauncher instead of SimpleJobRepository? I didn't notice a JobLauncherFactoryBean equivalent to AbstractJobRepositoryFactoryBean.


Affects: 2.0.0

Reference URL: http://forum.springsource.org/showpost.php?p=249913

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: corestatus: declinedFeatures that we don't intend to implement or Bug reports that are invalid or missing enough detailsstatus: waiting-for-reporterIssues for which we are waiting for feedback from the reportertype: feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions