Skip to content

Commit

Permalink
Fix JavaBean setter collision
Browse files Browse the repository at this point in the history
This commit changes the name of the overloaded
setter for isolationLevelForCreate to remove
ambiguity in setter selection by Spring Framework.

Resolves #4213
  • Loading branch information
fmbenhassine committed Oct 18, 2022
1 parent 05f6d13 commit de567e8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public JobRepository jobRepository() throws BatchConfigurationException {
jobRepositoryFactoryBean.setLobHandler(getLobHandler());
jobRepositoryFactoryBean.setCharset(getCharset());
jobRepositoryFactoryBean.setMaxVarCharLength(getMaxVarCharLength());
jobRepositoryFactoryBean.setIsolationLevelForCreate(getIsolationLevelForCreate());
jobRepositoryFactoryBean.setIsolationLevelForCreateEnum(getIsolationLevelForCreate());
jobRepositoryFactoryBean.setValidateTransactionState(getValidateTransactionState());
jobRepositoryFactoryBean.afterPropertiesSet();
return jobRepositoryFactoryBean.getObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void setIsolationLevelForCreate(String isolationLevelForCreate) {
* @see SimpleJobRepository#createJobExecution(String,
* org.springframework.batch.core.JobParameters)
*/
public void setIsolationLevelForCreate(Isolation isolationLevelForCreate) {
public void setIsolationLevelForCreateEnum(Isolation isolationLevelForCreate) {
this.setIsolationLevelForCreate(TRANSACTION_ISOLATION_LEVEL_PREFIX + isolationLevelForCreate.name());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ void testTransactionAttributesForCreateMethod() throws Exception {
@Test
void testSetTransactionAttributesForCreateMethod() throws Exception {

factory.setIsolationLevelForCreate(Isolation.READ_UNCOMMITTED);
factory.setIsolationLevelForCreateEnum(Isolation.READ_UNCOMMITTED);
testCreateRepository();
JobRepository repository = factory.getObject();
DefaultTransactionDefinition transactionDefinition = new DefaultTransactionDefinition(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public JobRepository jobRepository(DataSource dataSource, PlatformTransactionMan
throws Exception {
JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
factory.setDataSource(dataSource);
factory.setIsolationLevelForCreate(Isolation.READ_COMMITTED);
factory.setIsolationLevelForCreateEnum(Isolation.READ_COMMITTED);
factory.setTransactionManager(transactionManager);
factory.afterPropertiesSet();
return factory.getObject();
Expand Down

0 comments on commit de567e8

Please sign in to comment.