|
43 | 43 | import org.springframework.core.convert.support.DefaultConversionService;
|
44 | 44 | import org.springframework.jdbc.core.JdbcOperations;
|
45 | 45 | import org.springframework.jdbc.core.JdbcTemplate;
|
46 |
| -import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
47 | 46 | import org.springframework.jdbc.support.MetaDataAccessException;
|
48 | 47 | import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;
|
| 48 | +import org.springframework.transaction.PlatformTransactionManager; |
49 | 49 |
|
50 | 50 | import javax.sql.DataSource;
|
51 | 51 | import java.nio.charset.Charset;
|
@@ -142,20 +142,20 @@ protected DataSource getDataSource() {
|
142 | 142 | }
|
143 | 143 |
|
144 | 144 | @Override
|
145 |
| - protected DataSourceTransactionManager getTransactionManager() { |
146 |
| - String errorMessage = " To use the default configuration, a DataSourceTransactionManager bean named 'transactionManager'" |
| 145 | + protected PlatformTransactionManager getTransactionManager() { |
| 146 | + String errorMessage = " To use the default configuration, a PlatformTransactionManager bean named 'transactionManager'" |
147 | 147 | + " should be defined in the application context but none was found. Override getTransactionManager()"
|
148 | 148 | + " to provide the transaction manager to use for the job repository.";
|
149 |
| - if (this.applicationContext.getBeansOfType(DataSourceTransactionManager.class).isEmpty()) { |
| 149 | + if (this.applicationContext.getBeansOfType(PlatformTransactionManager.class).isEmpty()) { |
150 | 150 | throw new BatchConfigurationException(
|
151 |
| - "Unable to find a DataSourceTransactionManager bean in the application context." + errorMessage); |
| 151 | + "Unable to find a PlatformTransactionManager bean in the application context." + errorMessage); |
152 | 152 | }
|
153 | 153 | else {
|
154 | 154 | if (!this.applicationContext.containsBean("transactionManager")) {
|
155 | 155 | throw new BatchConfigurationException(errorMessage);
|
156 | 156 | }
|
157 | 157 | }
|
158 |
| - return this.applicationContext.getBean("transactionManager", DataSourceTransactionManager.class); |
| 158 | + return this.applicationContext.getBean("transactionManager", PlatformTransactionManager.class); |
159 | 159 | }
|
160 | 160 |
|
161 | 161 | /**
|
|
0 commit comments