Don't call close() on JNDI DataSource
Update the JNDI auto-configured DataSource so that the close method isn't called when the ApplicationContext is closed. Fixes gh-1520
This commit is contained in:
@@ -44,11 +44,11 @@ import org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup;
|
||||
@EnableConfigurationProperties(DataSourceProperties.class)
|
||||
public class JndiDataSourceAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@Bean(destroyMethod = "")
|
||||
@ConditionalOnMissingBean
|
||||
public DataSource dataSource(DataSourceProperties properties) {
|
||||
JndiDataSourceLookup dataSourceLookup = new JndiDataSourceLookup();
|
||||
return dataSourceLookup.getDataSource(properties.getJndiName());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user