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
pull/1694/head
Phillip Webb 10 years ago
parent a3527521a2
commit 517b40d9b9

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

Loading…
Cancel
Save