Skip to content

Revisit transactional advice around job repository methods #4956

@fmbenhassine

Description

@fmbenhassine

The transactional proxy created around the job repository in AbstractJobRepositoryFactoryBean is not accurate/optimized:

if (this.transactionAttributeSource == null) {
Properties transactionAttributes = new Properties();
transactionAttributes.setProperty("create*",
TRANSACTION_PROPAGATION_PREFIX + Propagation.REQUIRES_NEW + "," + this.isolationLevelForCreate);
transactionAttributes.setProperty("getLastJobExecution*",
TRANSACTION_PROPAGATION_PREFIX + Propagation.REQUIRES_NEW + "," + this.isolationLevelForCreate);
transactionAttributes.setProperty("*", "PROPAGATION_REQUIRED");
this.transactionAttributeSource = new NameMatchTransactionAttributeSource();
((NameMatchTransactionAttributeSource) this.transactionAttributeSource)
.setProperties(transactionAttributes);
}

For example, some methods (like get* and find*) could be marked as read-only.

v6 is a good opportunity to revisit and optimise this.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions