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:
Phillip Webb
2014-10-10 13:49:15 -07:00
parent a3527521a2
commit 517b40d9b9

View File

@@ -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());
}
}
}