Commit 5aab484e authored by Dave Syer's avatar Dave Syer

Merge 1.2.x to pick up DataSourceInitializer changes

parents 3ecf512a f1ecf534
......@@ -50,7 +50,6 @@ class DataSourceInitializer implements ApplicationListener<DataSourceInitialized
@Autowired
private ConfigurableApplicationContext applicationContext;
@Autowired(required = false)
private DataSource dataSource;
@Autowired
......@@ -59,11 +58,14 @@ class DataSourceInitializer implements ApplicationListener<DataSourceInitialized
private boolean initialized = false;
@PostConstruct
protected void initialize() {
public void init() {
if (!this.properties.isInitialize()) {
logger.debug("Initialization disabled (not running DDL scripts)");
return;
}
if (applicationContext.getBeanNamesForType(DataSource.class, false, false).length > 0) {
this.dataSource = applicationContext.getBean(DataSource.class);
}
if (this.dataSource == null) {
logger.debug("No DataSource found so not initializing");
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment