diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java index 4508d098b..583d04ebf 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java @@ -26,7 +26,7 @@ import org.springframework.batch.core.launch.support.SimpleJobLauncher; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean; import org.springframework.beans.factory.InitializingBean; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.stereotype.Component; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.util.Assert; @@ -49,11 +49,11 @@ public class DefaultBatchConfigurer implements BatchConfigurer, InitializingBean /** * Create a new {@link DefaultBatchConfigurer} with the passed datasource. This - * constructor will configure a default {@link DataSourceTransactionManager}. + * constructor will configure a default {@link JdbcTransactionManager}. * @param dataSource to use for the job repository and job explorer */ public DefaultBatchConfigurer(DataSource dataSource) { - this(dataSource, new DataSourceTransactionManager(dataSource)); + this(dataSource, new JdbcTransactionManager(dataSource)); } /** diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java index c23a31383..59edc8bb2 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java @@ -117,8 +117,8 @@ import org.springframework.transaction.PlatformTransactionManager; * * * The transaction manager provided by this annotation will be of type - * {@link org.springframework.jdbc.datasource.DataSourceTransactionManager} configured - * with the {@link javax.sql.DataSource} provided within the context. + * {@link org.springframework.jdbc.support.JdbcTransactionManager} configured with the + * {@link javax.sql.DataSource} provided within the context. * * In order to use a custom transaction manager, a custom {@link BatchConfigurer} should * be provided. For example: diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/DataSourceConfiguration.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/DataSourceConfiguration.java index f130764e4..708c93049 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/DataSourceConfiguration.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/DataSourceConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ResourceLoader; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.jdbc.datasource.init.DatabasePopulatorUtils; import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator; @@ -50,8 +50,8 @@ public class DataSourceConfiguration { } @Bean - public DataSourceTransactionManager transactionManager(DataSource dataSource) { - return new DataSourceTransactionManager(dataSource); + public JdbcTransactionManager transactionManager(DataSource dataSource) { + return new JdbcTransactionManager(dataSource); } } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/TransactionManagerConfigurationWithBatchConfigurerTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/TransactionManagerConfigurationWithBatchConfigurerTests.java index 5dbda44fe..90a667807 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/TransactionManagerConfigurationWithBatchConfigurerTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/TransactionManagerConfigurationWithBatchConfigurerTests.java @@ -29,7 +29,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.test.util.AopTestUtils; import org.springframework.transaction.PlatformTransactionManager; @@ -45,10 +45,9 @@ public class TransactionManagerConfigurationWithBatchConfigurerTests extends Tra BatchConfigurer batchConfigurer = applicationContext.getBean(BatchConfigurer.class); PlatformTransactionManager platformTransactionManager = batchConfigurer.getTransactionManager(); - Assert.assertTrue(platformTransactionManager instanceof DataSourceTransactionManager); - DataSourceTransactionManager dataSourceTransactionManager = AopTestUtils - .getTargetObject(platformTransactionManager); - Assert.assertEquals(applicationContext.getBean(DataSource.class), dataSourceTransactionManager.getDataSource()); + Assert.assertTrue(platformTransactionManager instanceof JdbcTransactionManager); + JdbcTransactionManager JdbcTransactionManager = AopTestUtils.getTargetObject(platformTransactionManager); + Assert.assertEquals(applicationContext.getBean(DataSource.class), JdbcTransactionManager.getDataSource()); Assert.assertSame(getTransactionManagerSetOnJobRepository(applicationContext.getBean(JobRepository.class)), platformTransactionManager); } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/TransactionManagerConfigurationWithoutBatchConfigurerTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/TransactionManagerConfigurationWithoutBatchConfigurerTests.java index e565279eb..f1013f030 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/TransactionManagerConfigurationWithoutBatchConfigurerTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/TransactionManagerConfigurationWithoutBatchConfigurerTests.java @@ -31,7 +31,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.test.util.AopTestUtils; import org.springframework.transaction.PlatformTransactionManager; @@ -68,9 +68,9 @@ public class TransactionManagerConfigurationWithoutBatchConfigurerTests extends BatchConfigurationWithDataSourceAndNoTransactionManager.class); PlatformTransactionManager platformTransactionManager = getTransactionManagerSetOnJobRepository( applicationContext.getBean(JobRepository.class)); - Assert.assertTrue(platformTransactionManager instanceof DataSourceTransactionManager); - DataSourceTransactionManager dataSourceTransactionManager = (DataSourceTransactionManager) platformTransactionManager; - Assert.assertEquals(applicationContext.getBean(DataSource.class), dataSourceTransactionManager.getDataSource()); + Assert.assertTrue(platformTransactionManager instanceof JdbcTransactionManager); + JdbcTransactionManager JdbcTransactionManager = (JdbcTransactionManager) platformTransactionManager; + Assert.assertEquals(applicationContext.getBean(DataSource.class), JdbcTransactionManager.getDataSource()); } @Test @@ -81,10 +81,10 @@ public class TransactionManagerConfigurationWithoutBatchConfigurerTests extends .getBean(PlatformTransactionManager.class); Assert.assertSame(transactionManager, platformTransactionManager); // In this case, the supplied transaction manager won't be used by batch and a - // DataSourceTransactionManager will be used instead. + // JdbcTransactionManager will be used instead. // The user has to provide a custom BatchConfigurer. Assert.assertTrue(getTransactionManagerSetOnJobRepository( - applicationContext.getBean(JobRepository.class)) instanceof DataSourceTransactionManager); + applicationContext.getBean(JobRepository.class)) instanceof JdbcTransactionManager); } @Test @@ -95,10 +95,10 @@ public class TransactionManagerConfigurationWithoutBatchConfigurerTests extends .getBean(PlatformTransactionManager.class); Assert.assertSame(transactionManager2, platformTransactionManager); // In this case, the supplied primary transaction manager won't be used by batch - // and a DataSourceTransactionManager will be used instead. + // and a JdbcTransactionManager will be used instead. // The user has to provide a custom BatchConfigurer. Assert.assertTrue(getTransactionManagerSetOnJobRepository( - applicationContext.getBean(JobRepository.class)) instanceof DataSourceTransactionManager); + applicationContext.getBean(JobRepository.class)) instanceof JdbcTransactionManager); } @Configuration diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepParserTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepParserTests.java index 4195537cc..b57d94c0c 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepParserTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2021 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.dao.DeadlockLoserDataAccessException; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.retry.RetryListener; import org.springframework.retry.listener.RetryListenerSupport; import org.springframework.test.util.ReflectionTestUtils; @@ -297,7 +297,7 @@ public class StepParserTests { public void testTransactionManagerDefaults() throws Exception { ApplicationContext ctx = stepParserParentAttributeTestsCtx; - assertTrue(getTransactionManager("defaultTxMgrStep", ctx) instanceof DataSourceTransactionManager); + assertTrue(getTransactionManager("defaultTxMgrStep", ctx) instanceof JdbcTransactionManager); assertDummyTransactionManager("specifiedTxMgrStep", "dummyTxMgr", ctx); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/job/ExtendedAbstractJobTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/job/ExtendedAbstractJobTests.java index e2bfd5e76..b151041dd 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/job/ExtendedAbstractJobTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/job/ExtendedAbstractJobTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2021 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean; import org.springframework.batch.core.step.StepSupport; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.lang.Nullable; @@ -61,7 +61,7 @@ public class ExtendedAbstractJobTests { .addScript("/org/springframework/batch/core/schema-hsqldb.sql").build(); JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); factory.setDataSource(embeddedDatabase); - factory.setTransactionManager(new DataSourceTransactionManager(embeddedDatabase)); + factory.setTransactionManager(new JdbcTransactionManager(embeddedDatabase)); factory.afterPropertiesSet(); jobRepository = factory.getObject(); job = new StubJob("job", jobRepository); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleJobFailureTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleJobFailureTests.java index eccfaef83..1a5419056 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleJobFailureTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleJobFailureTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2021 the original author or authors. + * Copyright 2008-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ import org.springframework.batch.core.UnexpectedJobExecutionException; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean; import org.springframework.batch.core.step.StepSupport; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; @@ -56,7 +56,7 @@ public class SimpleJobFailureTests { .addScript("/org/springframework/batch/core/schema-hsqldb.sql").build(); JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); factory.setDataSource(embeddedDatabase); - factory.setTransactionManager(new DataSourceTransactionManager(embeddedDatabase)); + factory.setTransactionManager(new JdbcTransactionManager(embeddedDatabase)); factory.afterPropertiesSet(); JobRepository jobRepository = factory.getObject(); job.setJobRepository(jobRepository); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleJobTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleJobTests.java index 640584f38..5f509194f 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleJobTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleJobTests.java @@ -49,7 +49,7 @@ import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean; import org.springframework.batch.core.step.StepSupport; import org.springframework.batch.item.ExecutionContext; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; @@ -97,7 +97,7 @@ public class SimpleJobTests { EmbeddedDatabase embeddedDatabase = new EmbeddedDatabaseBuilder() .addScript("/org/springframework/batch/core/schema-drop-hsqldb.sql") .addScript("/org/springframework/batch/core/schema-hsqldb.sql").generateUniqueName(true).build(); - DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(embeddedDatabase); + JdbcTransactionManager transactionManager = new JdbcTransactionManager(embeddedDatabase); JobRepositoryFactoryBean repositoryFactoryBean = new JobRepositoryFactoryBean(); repositoryFactoryBean.setDataSource(embeddedDatabase); repositoryFactoryBean.setTransactionManager(transactionManager); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleStepHandlerTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleStepHandlerTests.java index 33bacde29..43e06e466 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleStepHandlerTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleStepHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2021 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean; import org.springframework.batch.core.step.StepSupport; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; @@ -53,7 +53,7 @@ public class SimpleStepHandlerTests { .addScript("/org/springframework/batch/core/schema-hsqldb.sql").build(); JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); factory.setDataSource(embeddedDatabase); - factory.setTransactionManager(new DataSourceTransactionManager(embeddedDatabase)); + factory.setTransactionManager(new JdbcTransactionManager(embeddedDatabase)); factory.afterPropertiesSet(); jobRepository = factory.getObject(); jobExecution = jobRepository.createJobExecution("job", new JobParameters()); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/job/builder/FlowJobBuilderTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/job/builder/FlowJobBuilderTests.java index 95b6cd5f9..075f2aa58 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/job/builder/FlowJobBuilderTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/job/builder/FlowJobBuilderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.task.SimpleAsyncTaskExecutor; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.lang.Nullable; @@ -114,7 +114,7 @@ public class FlowJobBuilderTests { .addScript("/org/springframework/batch/core/schema-hsqldb.sql").build(); JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); factory.setDataSource(embeddedDatabase); - factory.setTransactionManager(new DataSourceTransactionManager(embeddedDatabase)); + factory.setTransactionManager(new JdbcTransactionManager(embeddedDatabase)); factory.afterPropertiesSet(); jobRepository = factory.getObject(); execution = jobRepository.createJobExecution("flow", new JobParameters()); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowJobFailureTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowJobFailureTests.java index 2794aa5cd..c1c3adb6f 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowJobFailureTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowJobFailureTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2021 the original author or authors. + * Copyright 2010-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ import org.springframework.batch.core.job.flow.support.state.StepState; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean; import org.springframework.batch.core.step.StepSupport; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; @@ -61,7 +61,7 @@ public class FlowJobFailureTests { .addScript("/org/springframework/batch/core/schema-hsqldb.sql").build(); JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); factory.setDataSource(embeddedDatabase); - factory.setTransactionManager(new DataSourceTransactionManager(embeddedDatabase)); + factory.setTransactionManager(new JdbcTransactionManager(embeddedDatabase)); factory.afterPropertiesSet(); JobRepository jobRepository = factory.getObject(); job.setJobRepository(jobRepository); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowJobTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowJobTests.java index 780eca10c..eab3419fe 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowJobTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowJobTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2021 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ import org.springframework.batch.core.job.flow.support.state.StepState; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean; import org.springframework.batch.core.step.StepSupport; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.lang.Nullable; @@ -78,7 +78,7 @@ public class FlowJobTests { .addScript("/org/springframework/batch/core/schema-hsqldb.sql").build(); JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); factory.setDataSource(embeddedDatabase); - factory.setTransactionManager(new DataSourceTransactionManager(embeddedDatabase)); + factory.setTransactionManager(new JdbcTransactionManager(embeddedDatabase)); factory.afterPropertiesSet(); this.jobRepository = factory.getObject(); job.setJobRepository(this.jobRepository); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowStepTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowStepTests.java index ef4ac81fa..4c0a3d8e7 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowStepTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowStepTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2021 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ import org.springframework.batch.core.job.flow.support.state.StepState; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean; import org.springframework.batch.core.step.StepSupport; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; @@ -59,7 +59,7 @@ public class FlowStepTests { .addScript("/org/springframework/batch/core/schema-hsqldb.sql").build(); JobRepositoryFactoryBean jobRepositoryFactoryBean = new JobRepositoryFactoryBean(); jobRepositoryFactoryBean.setDataSource(embeddedDatabase); - jobRepositoryFactoryBean.setTransactionManager(new DataSourceTransactionManager(embeddedDatabase)); + jobRepositoryFactoryBean.setTransactionManager(new JdbcTransactionManager(embeddedDatabase)); jobRepositoryFactoryBean.afterPropertiesSet(); jobRepository = jobRepositoryFactoryBean.getObject(); jobExecution = jobRepository.createJobExecution("job", new JobParameters()); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/PartitionStepTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/PartitionStepTests.java index 054db83ff..833a16c95 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/PartitionStepTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/PartitionStepTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2021 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ import org.springframework.batch.core.partition.PartitionHandler; import org.springframework.batch.core.partition.StepExecutionSplitter; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; @@ -57,7 +57,7 @@ public class PartitionStepTests { .addScript("/org/springframework/batch/core/schema-hsqldb.sql").build(); JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); factory.setDataSource(embeddedDatabase); - factory.setTransactionManager(new DataSourceTransactionManager(embeddedDatabase)); + factory.setTransactionManager(new JdbcTransactionManager(embeddedDatabase)); factory.afterPropertiesSet(); jobRepository = factory.getObject(); step.setJobRepository(jobRepository); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/RemoteStepExecutionAggregatorTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/RemoteStepExecutionAggregatorTests.java index 9fb1d3140..395b155cd 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/RemoteStepExecutionAggregatorTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/RemoteStepExecutionAggregatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2021 the original author or authors. + * Copyright 2011-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.explore.support.JobExplorerFactoryBean; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; @@ -53,7 +53,7 @@ public class RemoteStepExecutionAggregatorTests { .addScript("/org/springframework/batch/core/schema-hsqldb.sql").build(); JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); factory.setDataSource(embeddedDatabase); - factory.setTransactionManager(new DataSourceTransactionManager(embeddedDatabase)); + factory.setTransactionManager(new JdbcTransactionManager(embeddedDatabase)); factory.afterPropertiesSet(); JobRepository jobRepository = factory.getObject(); JobExplorerFactoryBean explorerFactoryBean = new JobExplorerFactoryBean(); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitterTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitterTests.java index 8a334f8c1..bcfc10ccd 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitterTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2021 the original author or authors. + * Copyright 2008-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean; import org.springframework.batch.core.step.tasklet.TaskletStep; import org.springframework.batch.item.ExecutionContext; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; @@ -60,7 +60,7 @@ public class SimpleStepExecutionSplitterTests { .addScript("/org/springframework/batch/core/schema-hsqldb.sql").build(); JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); factory.setDataSource(embeddedDatabase); - factory.setTransactionManager(new DataSourceTransactionManager(embeddedDatabase)); + factory.setTransactionManager(new JdbcTransactionManager(embeddedDatabase)); factory.afterPropertiesSet(); jobRepository = factory.getObject(); stepExecution = jobRepository.createJobExecution("job", new JobParameters()).createStepExecution("bar"); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/builder/StepBuilderTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/builder/StepBuilderTests.java index 8509fb408..b0745657d 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/builder/StepBuilderTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/builder/StepBuilderTests.java @@ -47,7 +47,7 @@ import org.springframework.batch.item.support.ListItemReader; import org.springframework.batch.item.support.ListItemWriter; import org.springframework.batch.item.support.PassThroughItemProcessor; import org.springframework.batch.support.transaction.ResourcelessTransactionManager; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.lang.Nullable; @@ -71,7 +71,7 @@ public class StepBuilderTests { EmbeddedDatabase embeddedDatabase = new EmbeddedDatabaseBuilder() .addScript("/org/springframework/batch/core/schema-drop-hsqldb.sql") .addScript("/org/springframework/batch/core/schema-hsqldb.sql").build(); - DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(embeddedDatabase); + JdbcTransactionManager transactionManager = new JdbcTransactionManager(embeddedDatabase); JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); factory.setDataSource(embeddedDatabase); factory.setTransactionManager(transactionManager); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java index 4759ae010..2f5aebe4c 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java @@ -50,7 +50,7 @@ import org.springframework.batch.item.support.AbstractItemCountingItemStreamItem import org.springframework.batch.item.support.ListItemReader; import org.springframework.batch.support.transaction.ResourcelessTransactionManager; import org.springframework.batch.support.transaction.TransactionAwareProxyFactory; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.lang.Nullable; @@ -103,7 +103,7 @@ public class FaultTolerantStepFactoryBeanRetryTests { EmbeddedDatabase embeddedDatabase = new EmbeddedDatabaseBuilder() .addScript("/org/springframework/batch/core/schema-drop-hsqldb.sql") .addScript("/org/springframework/batch/core/schema-hsqldb.sql").generateUniqueName(true).build(); - DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(embeddedDatabase); + JdbcTransactionManager transactionManager = new JdbcTransactionManager(embeddedDatabase); JobRepositoryFactoryBean repositoryFactoryBean = new JobRepositoryFactoryBean(); repositoryFactoryBean.setDataSource(embeddedDatabase); repositoryFactoryBean.setTransactionManager(transactionManager); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRollbackTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRollbackTests.java index 25548d1cc..1e56ba2d3 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRollbackTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRollbackTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2021 the original author or authors. + * Copyright 2009-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ import org.springframework.batch.item.support.ListItemReader; import org.springframework.batch.support.transaction.ResourcelessTransactionManager; import org.springframework.batch.support.transaction.TransactionAwareProxyFactory; import org.springframework.core.task.SimpleAsyncTaskExecutor; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.transaction.interceptor.RollbackRuleAttribute; @@ -114,7 +114,7 @@ public class FaultTolerantStepFactoryBeanRollbackTests { .addScript("/org/springframework/batch/core/schema-hsqldb.sql").build(); JobRepositoryFactoryBean repositoryFactory = new JobRepositoryFactoryBean(); repositoryFactory.setDataSource(embeddedDatabase); - repositoryFactory.setTransactionManager(new DataSourceTransactionManager(embeddedDatabase)); + repositoryFactory.setTransactionManager(new JdbcTransactionManager(embeddedDatabase)); repositoryFactory.afterPropertiesSet(); repository = repositoryFactory.getObject(); factory.setJobRepository(repository); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanTests.java index 8093925fe..e9ff018a5 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2021 the original author or authors. + * Copyright 2008-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,7 @@ import org.springframework.batch.item.WriteFailedException; import org.springframework.batch.item.WriterNotOpenException; import org.springframework.batch.item.support.AbstractItemStreamItemReader; import org.springframework.beans.factory.FactoryBean; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.lang.Nullable; @@ -113,7 +113,7 @@ public class FaultTolerantStepFactoryBeanTests { .addScript("/org/springframework/batch/core/schema-drop-hsqldb.sql") .addScript("/org/springframework/batch/core/schema-hsqldb-extended.sql").generateUniqueName(true) .build(); - DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(embeddedDatabase); + JdbcTransactionManager transactionManager = new JdbcTransactionManager(embeddedDatabase); factory = new FaultTolerantStepFactoryBean<>(); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanUnexpectedRollbackTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanUnexpectedRollbackTests.java index fe2bad839..702ec6a16 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanUnexpectedRollbackTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanUnexpectedRollbackTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2020 the original author or authors. + * Copyright 2010-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ import org.springframework.batch.core.step.factory.FaultTolerantStepFactoryBean; import org.springframework.batch.item.ItemReader; import org.springframework.batch.item.support.ListItemReader; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.TransactionException; @@ -62,7 +62,7 @@ public class FaultTolerantStepFactoryBeanUnexpectedRollbackTests { factory.setItemWriter(writer); @SuppressWarnings("serial") - DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(dataSource) { + JdbcTransactionManager transactionManager = new JdbcTransactionManager(dataSource) { private boolean failed = false; @Override diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleStepFactoryBeanTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleStepFactoryBeanTests.java index 64fae37ac..84678b655 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleStepFactoryBeanTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleStepFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2021 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,7 @@ import org.springframework.batch.repeat.exception.SimpleLimitExceptionHandler; import org.springframework.batch.repeat.policy.SimpleCompletionPolicy; import org.springframework.batch.support.transaction.ResourcelessTransactionManager; import org.springframework.core.task.SimpleAsyncTaskExecutor; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.lang.Nullable; @@ -87,7 +87,7 @@ public class SimpleStepFactoryBeanTests { EmbeddedDatabase embeddedDatabase = new EmbeddedDatabaseBuilder() .addScript("/org/springframework/batch/core/schema-drop-hsqldb.sql") .addScript("/org/springframework/batch/core/schema-hsqldb.sql").generateUniqueName(true).build(); - DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(embeddedDatabase); + JdbcTransactionManager transactionManager = new JdbcTransactionManager(embeddedDatabase); JobRepositoryFactoryBean repositoryFactoryBean = new JobRepositoryFactoryBean(); repositoryFactoryBean.setDataSource(embeddedDatabase); repositoryFactoryBean.setTransactionManager(transactionManager); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/job/JobStepTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/job/JobStepTests.java index a74072798..c8642e451 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/job/JobStepTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/job/JobStepTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2021 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ import org.springframework.batch.core.launch.support.SimpleJobLauncher; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean; import org.springframework.batch.item.ExecutionContext; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; @@ -59,7 +59,7 @@ public class JobStepTests { .addScript("/org/springframework/batch/core/schema-hsqldb.sql").build(); JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); factory.setDataSource(embeddedDatabase); - factory.setTransactionManager(new DataSourceTransactionManager(embeddedDatabase)); + factory.setTransactionManager(new JdbcTransactionManager(embeddedDatabase)); factory.afterPropertiesSet(); jobRepository = factory.getObject(); step.setJobRepository(jobRepository); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/StepExecutorInterruptionTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/StepExecutorInterruptionTests.java index 7a15967d8..2b77ccfdd 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/StepExecutorInterruptionTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/StepExecutorInterruptionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2021 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ import org.springframework.batch.item.ItemReader; import org.springframework.batch.item.ItemWriter; import org.springframework.batch.repeat.policy.SimpleCompletionPolicy; import org.springframework.batch.repeat.support.RepeatTemplate; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.lang.Nullable; @@ -68,7 +68,7 @@ public class StepExecutorInterruptionTests { EmbeddedDatabase embeddedDatabase = new EmbeddedDatabaseBuilder() .addScript("/org/springframework/batch/core/schema-drop-hsqldb.sql") .addScript("/org/springframework/batch/core/schema-hsqldb.sql").generateUniqueName(true).build(); - this.transactionManager = new DataSourceTransactionManager(embeddedDatabase); + this.transactionManager = new JdbcTransactionManager(embeddedDatabase); JobRepositoryFactoryBean repositoryFactoryBean = new JobRepositoryFactoryBean(); repositoryFactoryBean.setDataSource(embeddedDatabase); repositoryFactoryBean.setTransactionManager(this.transactionManager); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/TaskletStepTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/TaskletStepTests.java index f1592d1ef..76e541611 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/TaskletStepTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/TaskletStepTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2021 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,7 @@ import org.springframework.batch.repeat.policy.SimpleCompletionPolicy; import org.springframework.batch.repeat.support.RepeatTemplate; import org.springframework.batch.support.transaction.ResourcelessTransactionManager; import org.springframework.dao.DataAccessResourceFailureException; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.lang.Nullable; @@ -231,7 +231,7 @@ public class TaskletStepTests { EmbeddedDatabase embeddedDatabase = new EmbeddedDatabaseBuilder() .addScript("/org/springframework/batch/core/schema-drop-hsqldb.sql") .addScript("/org/springframework/batch/core/schema-hsqldb.sql").build(); - DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(embeddedDatabase); + JdbcTransactionManager transactionManager = new JdbcTransactionManager(embeddedDatabase); JobRepositoryFactoryBean repositoryFactoryBean = new JobRepositoryFactoryBean(); repositoryFactoryBean.setDataSource(embeddedDatabase); repositoryFactoryBean.setTransactionManager(transactionManager); diff --git a/spring-batch-core/src/test/java/test/jdbc/datasource/DataSourceInitializer.java b/spring-batch-core/src/test/java/test/jdbc/datasource/DataSourceInitializer.java index db87a77a1..7faa3f67f 100644 --- a/spring-batch-core/src/test/java/test/jdbc/datasource/DataSourceInitializer.java +++ b/spring-batch-core/src/test/java/test/jdbc/datasource/DataSourceInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2013 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.core.io.Resource; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionTemplate; @@ -49,6 +49,7 @@ import org.springframework.util.StringUtils; * Java Application. Do the same any time you want to wipe the database and start again. * * @author Dave Syer + * @author Mahmoud Ben Hassine * */ public class DataSourceInitializer implements InitializingBean { @@ -97,7 +98,7 @@ public class DataSourceInitializer implements InitializingBean { throw new IllegalArgumentException("Script resource is null or does not exist"); } - TransactionTemplate transactionTemplate = new TransactionTemplate(new DataSourceTransactionManager(dataSource)); + TransactionTemplate transactionTemplate = new TransactionTemplate(new JdbcTransactionManager(dataSource)); transactionTemplate.execute(new TransactionCallback() { @Override diff --git a/spring-batch-core/src/test/resources/applicationContext-test2.xml b/spring-batch-core/src/test/resources/applicationContext-test2.xml index 720f7b7e5..db8e78aa3 100644 --- a/spring-batch-core/src/test/resources/applicationContext-test2.xml +++ b/spring-batch-core/src/test/resources/applicationContext-test2.xml @@ -58,7 +58,7 @@ - + diff --git a/spring-batch-core/src/test/resources/data-source-context.xml b/spring-batch-core/src/test/resources/data-source-context.xml index 43cd0cbec..101480999 100644 --- a/spring-batch-core/src/test/resources/data-source-context.xml +++ b/spring-batch-core/src/test/resources/data-source-context.xml @@ -24,7 +24,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/annotation/JobScopeConfigurationTestsXmlImportUsingNamespace-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/annotation/JobScopeConfigurationTestsXmlImportUsingNamespace-context.xml index f49e1b9b3..7f612ef24 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/annotation/JobScopeConfigurationTestsXmlImportUsingNamespace-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/annotation/JobScopeConfigurationTestsXmlImportUsingNamespace-context.xml @@ -3,7 +3,7 @@ xmlns:batch="http://www.springframework.org/schema/batch" xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/batch https://www.springframework.org/schema/batch/spring-batch.xsd"> - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/support/JobRegistryIntegrationTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/support/JobRegistryIntegrationTests-context.xml index 4eb4127df..27e850d3a 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/support/JobRegistryIntegrationTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/support/JobRegistryIntegrationTests-context.xml @@ -22,7 +22,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/BeanDefinitionOverrideTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/BeanDefinitionOverrideTests-context.xml index a312da203..93f55bef0 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/BeanDefinitionOverrideTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/BeanDefinitionOverrideTests-context.xml @@ -23,7 +23,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/InlineItemHandlerWithStepScopeParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/InlineItemHandlerWithStepScopeParserTests-context.xml index 485e830d3..bcbbbcb9a 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/InlineItemHandlerWithStepScopeParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/InlineItemHandlerWithStepScopeParserTests-context.xml @@ -13,7 +13,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRegistryJobParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRegistryJobParserTests-context.xml index 63ea5dc50..44e43a48c 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRegistryJobParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRegistryJobParserTests-context.xml @@ -12,7 +12,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRepositoryDefaultParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRepositoryDefaultParserTests-context.xml index 7fe83ddf4..0fa13ef81 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRepositoryDefaultParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRepositoryDefaultParserTests-context.xml @@ -7,7 +7,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRepositoryParserReferenceTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRepositoryParserReferenceTests-context.xml index a1942c0ad..1f19f8b36 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRepositoryParserReferenceTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRepositoryParserReferenceTests-context.xml @@ -8,7 +8,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRepositoryParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRepositoryParserTests-context.xml index 37aba3df2..e7993737b 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRepositoryParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobRepositoryParserTests-context.xml @@ -11,7 +11,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/PartitionStepWithNonDefaultTransactionManagerParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/PartitionStepWithNonDefaultTransactionManagerParserTests-context.xml index eed586cda..bc45a20cd 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/PartitionStepWithNonDefaultTransactionManagerParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/PartitionStepWithNonDefaultTransactionManagerParserTests-context.xml @@ -24,7 +24,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/RepositoryJobParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/RepositoryJobParserTests-context.xml index 3958c8b00..8452fd89d 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/RepositoryJobParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/RepositoryJobParserTests-context.xml @@ -13,7 +13,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserTaskletAttributesTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserTaskletAttributesTests-context.xml index 534359cfd..1be26b582 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserTaskletAttributesTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserTaskletAttributesTests-context.xml @@ -55,7 +55,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/TaskletParserAdapterTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/TaskletParserAdapterTests-context.xml index b51c860ca..0712a01f4 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/TaskletParserAdapterTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/TaskletParserAdapterTests-context.xml @@ -30,7 +30,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/TaskletParserBeanPropertiesTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/TaskletParserBeanPropertiesTests-context.xml index 0a286d868..1e96f9808 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/TaskletParserBeanPropertiesTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/TaskletParserBeanPropertiesTests-context.xml @@ -44,7 +44,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/TaskletStepAllowStartIfCompleteTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/TaskletStepAllowStartIfCompleteTests-context.xml index 11046a19f..b3870f2ca 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/TaskletStepAllowStartIfCompleteTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/TaskletStepAllowStartIfCompleteTests-context.xml @@ -12,7 +12,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/common-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/common-context.xml index 8c8ae0f3a..8514a6557 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/common-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/common-context.xml @@ -12,7 +12,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/launch/JobLauncherIntegrationTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/launch/JobLauncherIntegrationTests-context.xml index fe3b13ea0..cabf05327 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/launch/JobLauncherIntegrationTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/launch/JobLauncherIntegrationTests-context.xml @@ -31,7 +31,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/OptimisticLockingFailureTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/OptimisticLockingFailureTests-context.xml index cbe1d992d..eefb84e55 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/OptimisticLockingFailureTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/OptimisticLockingFailureTests-context.xml @@ -44,7 +44,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/TablePrefixTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/TablePrefixTests-context.xml index a462c65b2..37b95908f 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/TablePrefixTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/TablePrefixTests-context.xml @@ -35,7 +35,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/data-source-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/data-source-context.xml index 36efc60f9..aa1f06eb4 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/data-source-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/data-source-context.xml @@ -17,7 +17,7 @@ - + - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/step/RestartInPriorStepTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/step/RestartInPriorStepTests-context.xml index c9074c0a7..2b187868e 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/step/RestartInPriorStepTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/step/RestartInPriorStepTests-context.xml @@ -81,7 +81,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/step/RestartLoopTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/step/RestartLoopTests-context.xml index 5669ccfd0..4b7766cb8 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/step/RestartLoopTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/step/RestartLoopTests-context.xml @@ -30,7 +30,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/step/item/FaultTolerantExceptionClassesTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/step/item/FaultTolerantExceptionClassesTests-context.xml index 375552ab9..94c1b48bf 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/step/item/FaultTolerantExceptionClassesTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/step/item/FaultTolerantExceptionClassesTests-context.xml @@ -152,7 +152,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/step/item/ScriptItemProcessorTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/step/item/ScriptItemProcessorTests-context.xml index 07535e872..ab7a8a912 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/step/item/ScriptItemProcessorTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/step/item/ScriptItemProcessorTests-context.xml @@ -22,7 +22,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/step/skip/ReprocessExceptionTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/step/skip/ReprocessExceptionTests-context.xml index c9ecc60cc..b07fe5da4 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/step/skip/ReprocessExceptionTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/step/skip/ReprocessExceptionTests-context.xml @@ -51,7 +51,7 @@ - + diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/ExtendedConnectionDataSourceProxyTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/ExtendedConnectionDataSourceProxyTests.java index 06d2d74f5..a65f8ae09 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/ExtendedConnectionDataSourceProxyTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/ExtendedConnectionDataSourceProxyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2018 the original author or authors. + * Copyright 2009-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ import javax.sql.DataSource; import org.junit.Test; import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.DataSourceUtils; import org.springframework.jdbc.datasource.SmartDataSource; import org.springframework.transaction.PlatformTransactionManager; @@ -183,7 +183,7 @@ public class ExtendedConnectionDataSourceProxyTests { final ExtendedConnectionDataSourceProxy csds = new ExtendedConnectionDataSourceProxy(); csds.setDataSource(ds); - PlatformTransactionManager tm = new DataSourceTransactionManager(csds); + PlatformTransactionManager tm = new JdbcTransactionManager(csds); TransactionTemplate tt = new TransactionTemplate(tm); final TransactionTemplate tt2 = new TransactionTemplate(tm); tt2.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcCursorItemReaderConfigTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcCursorItemReaderConfigTests.java index ff963ec2e..d90e21fa7 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcCursorItemReaderConfigTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcCursorItemReaderConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2014 the original author or authors. + * Copyright 2008-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ import org.junit.runners.JUnit4; import org.mockito.ArgumentCaptor; import org.springframework.batch.item.ExecutionContext; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallback; @@ -56,7 +56,7 @@ public class JdbcCursorItemReaderConfigTests { when(ds.getConnection()).thenReturn(con); when(ds.getConnection()).thenReturn(con); con.commit(); - PlatformTransactionManager tm = new DataSourceTransactionManager(ds); + PlatformTransactionManager tm = new JdbcTransactionManager(ds); TransactionTemplate tt = new TransactionTemplate(tm); final JdbcCursorItemReader reader = new JdbcCursorItemReader<>(); reader.setDataSource(new ExtendedConnectionDataSourceProxy(ds)); @@ -88,7 +88,7 @@ public class JdbcCursorItemReaderConfigTests { when(ds.getConnection()).thenReturn(con); when(ds.getConnection()).thenReturn(con); con.commit(); - PlatformTransactionManager tm = new DataSourceTransactionManager(ds); + PlatformTransactionManager tm = new JdbcTransactionManager(ds); TransactionTemplate tt = new TransactionTemplate(tm); final JdbcCursorItemReader reader = new JdbcCursorItemReader<>(); reader.setDataSource(ds); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/StoredprocedureItemReaderConfigTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/StoredprocedureItemReaderConfigTests.java index 7228d11bb..f284100d1 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/StoredprocedureItemReaderConfigTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/StoredprocedureItemReaderConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2014 the original author or authors. + * Copyright 2010-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ import org.junit.runner.RunWith; import org.springframework.batch.item.ExecutionContext; import org.springframework.jdbc.core.PreparedStatementSetter; import org.springframework.jdbc.core.SqlParameter; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallback; @@ -61,7 +61,7 @@ public class StoredprocedureItemReaderConfigTests { when(ds.getConnection()).thenReturn(con); when(ds.getConnection()).thenReturn(con); con.commit(); - PlatformTransactionManager tm = new DataSourceTransactionManager(ds); + PlatformTransactionManager tm = new JdbcTransactionManager(ds); TransactionTemplate tt = new TransactionTemplate(tm); final StoredProcedureItemReader reader = new StoredProcedureItemReader<>(); reader.setDataSource(new ExtendedConnectionDataSourceProxy(ds)); @@ -97,7 +97,7 @@ public class StoredprocedureItemReaderConfigTests { when(ds.getConnection()).thenReturn(con); when(ds.getConnection()).thenReturn(con); con.commit(); - PlatformTransactionManager tm = new DataSourceTransactionManager(ds); + PlatformTransactionManager tm = new JdbcTransactionManager(ds); TransactionTemplate tt = new TransactionTemplate(tm); final StoredProcedureItemReader reader = new StoredProcedureItemReader<>(); reader.setDataSource(ds); @@ -132,7 +132,7 @@ public class StoredprocedureItemReaderConfigTests { when(ds.getConnection()).thenReturn(con); when(ds.getConnection()).thenReturn(con); con.commit(); - PlatformTransactionManager tm = new DataSourceTransactionManager(ds); + PlatformTransactionManager tm = new JdbcTransactionManager(ds); TransactionTemplate tt = new TransactionTemplate(tm); final StoredProcedureItemReader reader = new StoredProcedureItemReader<>(); reader.setDataSource(ds); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/builder/StoredProcedureItemReaderBuilderTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/builder/StoredProcedureItemReaderBuilderTests.java index 6f98d526d..10de927a3 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/builder/StoredProcedureItemReaderBuilderTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/builder/StoredProcedureItemReaderBuilderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2019 the original author or authors. + * Copyright 2017-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ClassPathResource; import org.springframework.jdbc.core.ArgumentPreparedStatementSetter; import org.springframework.jdbc.core.SqlParameter; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.test.util.ReflectionTestUtils; import org.springframework.transaction.PlatformTransactionManager; @@ -190,7 +190,7 @@ public class StoredProcedureItemReaderBuilderTests { @Bean public PlatformTransactionManager transactionManager(DataSource dataSource) { - DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(); + JdbcTransactionManager transactionManager = new JdbcTransactionManager(); transactionManager.setDataSource(dataSource); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/H2PagingQueryProviderIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/H2PagingQueryProviderIntegrationTests.java index ce7b4f466..30bca9811 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/H2PagingQueryProviderIntegrationTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/H2PagingQueryProviderIntegrationTests.java @@ -31,7 +31,7 @@ import org.junit.runners.Parameterized.Parameters; import org.springframework.batch.item.database.Order; import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.SimpleDriverDataSource; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.support.TransactionTemplate; @@ -41,6 +41,7 @@ import static org.junit.Assert.assertEquals; /** * @author Henning Pƶttker + * @author Mahmoud Ben Hassine */ @RunWith(Parameterized.class) public class H2PagingQueryProviderIntegrationTests { @@ -56,7 +57,7 @@ public class H2PagingQueryProviderIntegrationTests { String connectionUrl = String.format("jdbc:h2:mem:%s;MODE=%s", UUID.randomUUID(), compatibilityMode); DataSource dataSource = new SimpleDriverDataSource(new org.h2.Driver(), connectionUrl, "sa", ""); JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); - PlatformTransactionManager transactionManager = new DataSourceTransactionManager(dataSource); + PlatformTransactionManager transactionManager = new JdbcTransactionManager(dataSource); TransactionTemplate transactionTemplate = new TransactionTemplate(transactionManager); transactionTemplate.executeWithoutResult(status -> { diff --git a/spring-batch-infrastructure/src/test/java/test/jdbc/datasource/DataSourceInitializer.java b/spring-batch-infrastructure/src/test/java/test/jdbc/datasource/DataSourceInitializer.java index 46e2ddb45..9785cdf5c 100644 --- a/spring-batch-infrastructure/src/test/java/test/jdbc/datasource/DataSourceInitializer.java +++ b/spring-batch-infrastructure/src/test/java/test/jdbc/datasource/DataSourceInitializer.java @@ -31,7 +31,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.core.io.Resource; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionTemplate; @@ -50,6 +50,7 @@ import org.springframework.util.StringUtils; * Java Application. Do the same any time you want to wipe the database and start again. * * @author Dave Syer + * @author Mahmoud Ben Hassine * */ public class DataSourceInitializer implements InitializingBean, DisposableBean { @@ -125,7 +126,7 @@ public class DataSourceInitializer implements InitializingBean, DisposableBean { return; final JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); - TransactionTemplate transactionTemplate = new TransactionTemplate(new DataSourceTransactionManager(dataSource)); + TransactionTemplate transactionTemplate = new TransactionTemplate(new JdbcTransactionManager(dataSource)); transactionTemplate.execute(new TransactionCallback() { @Override diff --git a/spring-batch-infrastructure/src/test/resources/data-source-context.xml b/spring-batch-infrastructure/src/test/resources/data-source-context.xml index 3f7b27533..ffd2e89e7 100644 --- a/spring-batch-infrastructure/src/test/resources/data-source-context.xml +++ b/spring-batch-infrastructure/src/test/resources/data-source-context.xml @@ -19,7 +19,7 @@ - + diff --git a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderCommonTests-context.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderCommonTests-context.xml index f68f311eb..93a8eb4af 100644 --- a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderCommonTests-context.xml +++ b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderCommonTests-context.xml @@ -8,7 +8,7 @@ - + diff --git a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderConfigTests-context.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderConfigTests-context.xml index 3ec6109d4..c709adb34 100644 --- a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderConfigTests-context.xml +++ b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderConfigTests-context.xml @@ -9,7 +9,7 @@ - + diff --git a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderParameterTests-context.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderParameterTests-context.xml index 54e0c4db7..d89679b56 100644 --- a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderParameterTests-context.xml +++ b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderParameterTests-context.xml @@ -13,7 +13,7 @@ - + diff --git a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/data-source-context.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/data-source-context.xml index c62d54ff8..492f47627 100644 --- a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/data-source-context.xml +++ b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/data-source-context.xml @@ -13,7 +13,7 @@ - + - + diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkMessageItemWriterIntegrationTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkMessageItemWriterIntegrationTests.java index 76e2b30fa..d297cb733 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkMessageItemWriterIntegrationTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkMessageItemWriterIntegrationTests.java @@ -43,7 +43,7 @@ import org.springframework.batch.item.support.ListItemReader; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.integration.core.MessagingTemplate; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.messaging.Message; @@ -82,7 +82,7 @@ public class ChunkMessageItemWriterIntegrationTests { EmbeddedDatabase embeddedDatabase = new EmbeddedDatabaseBuilder().generateUniqueName(true) .addScript("/org/springframework/batch/core/schema-drop-hsqldb.sql") .addScript("/org/springframework/batch/core/schema-hsqldb.sql").build(); - DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(embeddedDatabase); + JdbcTransactionManager transactionManager = new JdbcTransactionManager(embeddedDatabase); JobRepositoryFactoryBean repositoryFactoryBean = new JobRepositoryFactoryBean(); repositoryFactoryBean.setDataSource(embeddedDatabase); repositoryFactoryBean.setTransactionManager(transactionManager); diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkingManagerStepBuilderTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkingManagerStepBuilderTests.java index a12b411b6..d1de4f8e0 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkingManagerStepBuilderTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkingManagerStepBuilderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2021 the original author or authors. + * Copyright 2018-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.integration.channel.DirectChannel; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.core.MessagingTemplate; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.lang.Nullable; import org.springframework.messaging.PollableChannel; @@ -325,8 +325,8 @@ public class RemoteChunkingManagerStepBuilderTests { } @Bean - public DataSourceTransactionManager transactionManager(DataSource dataSource) { - return new DataSourceTransactionManager(dataSource); + public JdbcTransactionManager transactionManager(DataSource dataSource) { + return new JdbcTransactionManager(dataSource); } } diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests-context.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests-context.xml index 46890c505..83885bac4 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests-context.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests-context.xml @@ -83,7 +83,7 @@ - + diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepJdbcIntegrationTests-context.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepJdbcIntegrationTests-context.xml index e1bb140eb..8464b96e9 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepJdbcIntegrationTests-context.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepJdbcIntegrationTests-context.xml @@ -110,7 +110,7 @@ - + diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepJmsIntegrationTests-context.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepJmsIntegrationTests-context.xml index 0fbbb04cf..2472da975 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepJmsIntegrationTests-context.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepJmsIntegrationTests-context.xml @@ -112,7 +112,7 @@ - + diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkStepIntegrationTests-context.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkStepIntegrationTests-context.xml index c302a604b..29d7f10a8 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkStepIntegrationTests-context.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkStepIntegrationTests-context.xml @@ -68,7 +68,7 @@ - + diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingManagerParserTests.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingManagerParserTests.xml index 8dacd1876..4cb4c9a53 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingManagerParserTests.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingManagerParserTests.xml @@ -52,6 +52,6 @@ p:driverClassName="${batch.jdbc.driver}" p:url="${batch.jdbc.url}" p:username="${batch.jdbc.user}" p:password="${batch.jdbc.password}"/> - diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserTests.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserTests.xml index 8dacd1876..4cb4c9a53 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserTests.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserTests.xml @@ -52,6 +52,6 @@ p:driverClassName="${batch.jdbc.driver}" p:url="${batch.jdbc.url}" p:username="${batch.jdbc.user}" p:password="${batch.jdbc.password}"/> - diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/batch-setup-context.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/batch-setup-context.xml index 93d170d57..5d918b386 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/batch-setup-context.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/batch-setup-context.xml @@ -14,7 +14,7 @@ - + diff --git a/spring-batch-integration/src/test/resources/simple-job-launcher-context.xml b/spring-batch-integration/src/test/resources/simple-job-launcher-context.xml index 1373b6640..d18c02c4b 100644 --- a/spring-batch-integration/src/test/resources/simple-job-launcher-context.xml +++ b/spring-batch-integration/src/test/resources/simple-job-launcher-context.xml @@ -15,7 +15,7 @@ - + diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/DataSourceConfiguration.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/DataSourceConfiguration.java index 353f6c913..0b55d46c7 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/DataSourceConfiguration.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/DataSourceConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 the original author or authors. + * Copyright 2021-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import javax.sql.DataSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; /** @@ -36,8 +36,8 @@ public class DataSourceConfiguration { } @Bean - public DataSourceTransactionManager transactionManager(DataSource dataSource) { - return new DataSourceTransactionManager(dataSource); + public JdbcTransactionManager transactionManager(DataSource dataSource) { + return new JdbcTransactionManager(dataSource); } } diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/DataSourceConfiguration.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/DataSourceConfiguration.java index 34d664184..2ba2da312 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/DataSourceConfiguration.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/DataSourceConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2021 the original author or authors. + * Copyright 2018-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; /** * @author Mahmoud Ben Hassine @@ -52,8 +52,8 @@ public class DataSourceConfiguration { } @Bean - public DataSourceTransactionManager transactionManager(DataSource dataSource) { - return new DataSourceTransactionManager(dataSource); + public JdbcTransactionManager transactionManager(DataSource dataSource) { + return new JdbcTransactionManager(dataSource); } } diff --git a/spring-batch-samples/src/main/resources/data-source-context.xml b/spring-batch-samples/src/main/resources/data-source-context.xml index 210b148b7..e2c546d91 100644 --- a/spring-batch-samples/src/main/resources/data-source-context.xml +++ b/spring-batch-samples/src/main/resources/data-source-context.xml @@ -21,7 +21,7 @@ - + diff --git a/spring-batch-test/src/main/java/org/springframework/batch/test/DataSourceInitializer.java b/spring-batch-test/src/main/java/org/springframework/batch/test/DataSourceInitializer.java index 038758eb5..400797f7b 100755 --- a/spring-batch-test/src/main/java/org/springframework/batch/test/DataSourceInitializer.java +++ b/spring-batch-test/src/main/java/org/springframework/batch/test/DataSourceInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2021 the original author or authors. + * Copyright 2006-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.core.io.Resource; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionTemplate; import org.springframework.util.Assert; @@ -124,8 +124,7 @@ public class DataSourceInitializer implements InitializingBean, DisposableBean { if (scriptResource == null || !scriptResource.exists()) { return; } - TransactionTemplate transactionTemplate = new TransactionTemplate( - new DataSourceTransactionManager(this.dataSource)); + TransactionTemplate transactionTemplate = new TransactionTemplate(new JdbcTransactionManager(this.dataSource)); transactionTemplate.execute((TransactionCallback) status -> { JdbcTemplate jdbcTemplate = new JdbcTemplate(this.dataSource); String[] scripts; diff --git a/spring-batch-test/src/test/resources/data-source-context.xml b/spring-batch-test/src/test/resources/data-source-context.xml index 07c15e002..3180cdfe8 100755 --- a/spring-batch-test/src/test/resources/data-source-context.xml +++ b/spring-batch-test/src/test/resources/data-source-context.xml @@ -24,7 +24,7 @@ diff --git a/spring-batch-test/src/test/resources/org/springframework/batch/test/StepScopeTestExecutionListenerIntegrationTests-context.xml b/spring-batch-test/src/test/resources/org/springframework/batch/test/StepScopeTestExecutionListenerIntegrationTests-context.xml index 3f4a40692..6a764336b 100644 --- a/spring-batch-test/src/test/resources/org/springframework/batch/test/StepScopeTestExecutionListenerIntegrationTests-context.xml +++ b/spring-batch-test/src/test/resources/org/springframework/batch/test/StepScopeTestExecutionListenerIntegrationTests-context.xml @@ -14,7 +14,7 @@ - +